Base ItemComponents can apply OnUse statuseffects, grenades can be placed in detonators. Closes #113
This commit is contained in:
@@ -516,15 +516,12 @@ namespace Barotrauma
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (useItemCount > 0)
|
||||
|
||||
for (int i = 0; i < useItemCount; i++)
|
||||
{
|
||||
for (int i=0; i<useItemCount; i++)
|
||||
foreach (Item item in targets.FindAll(t => t is Item).Cast<Item>())
|
||||
{
|
||||
foreach (Item item in targets.FindAll(t => t is Item).Cast<Item>())
|
||||
{
|
||||
item.Use(deltaTime, targets.FirstOrDefault(t => t is Character) as Character);
|
||||
}
|
||||
item.Use(deltaTime, targets.FirstOrDefault(t => t is Character) as Character);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ namespace Barotrauma.Items.Components
|
||||
//returns true if the item was used succesfully (not out of ammo, reloading, etc)
|
||||
public virtual bool Use(float deltaTime, Character character = null)
|
||||
{
|
||||
return false;
|
||||
return characterUsable || character == null;
|
||||
}
|
||||
|
||||
//called when the item is equipped and right mouse button is pressed
|
||||
|
||||
Reference in New Issue
Block a user