| @@ -464,11 +464,20 @@ namespace GameClass.GameObj | |||||
| { | { | ||||
| lock (gameObjLock) | lock (gameObjLock) | ||||
| { | { | ||||
| foreach (Prop prop in propInventory) | |||||
| if (propType == PropType.Null) | |||||
| { | { | ||||
| if (prop.GetPropType() == propType) | |||||
| return prop; | |||||
| foreach (Prop prop in propInventory) | |||||
| { | |||||
| if (prop.GetPropType() != PropType.Null) | |||||
| return prop; | |||||
| } | |||||
| } | } | ||||
| else | |||||
| foreach (Prop prop in propInventory) | |||||
| { | |||||
| if (prop.GetPropType() == propType) | |||||
| return prop; | |||||
| } | |||||
| return new NullProp(); | return new NullProp(); | ||||
| } | } | ||||
| } | } | ||||
| @@ -358,17 +358,17 @@ namespace Gaming | |||||
| _ = attackManager.Attack(player, angle); | _ = attackManager.Attack(player, angle); | ||||
| } | } | ||||
| } | } | ||||
| public void UseProp(long playerID, PropType propType) | |||||
| public void UseProp(long playerID, PropType propType = PropType.Null) | |||||
| { | { | ||||
| if (!gameMap.Timer.IsGaming) | if (!gameMap.Timer.IsGaming) | ||||
| return; | return; | ||||
| Character? player = gameMap.FindPlayer(playerID); | Character? player = gameMap.FindPlayer(playerID); | ||||
| if (player != null) | if (player != null) | ||||
| { | { | ||||
| propManager.UseProp(player, propType); | |||||
| PropManager.UseProp(player, propType); | |||||
| } | } | ||||
| } | } | ||||
| public void ThrowProp(long playerID, PropType propType) | |||||
| public void ThrowProp(long playerID, PropType propType = PropType.Null) | |||||
| { | { | ||||
| if (!gameMap.Timer.IsGaming) | if (!gameMap.Timer.IsGaming) | ||||
| return; | return; | ||||
| @@ -21,7 +21,7 @@ namespace Gaming | |||||
| private readonly List<XY> availableCellForGenerateProp; | private readonly List<XY> availableCellForGenerateProp; | ||||
| public void UseProp(Character player, PropType propType) | |||||
| public static void UseProp(Character player, PropType propType) | |||||
| { | { | ||||
| if (player.IsResetting) | if (player.IsResetting) | ||||
| return; | return; | ||||