Remove AmmoPool-awareness from Armament

This commit is contained in:
reaperrr
2017-10-15 18:28:33 +02:00
committed by Paul Chote
parent ded92f394c
commit 8b7a71685c
7 changed files with 66 additions and 51 deletions

View File

@@ -59,17 +59,9 @@ namespace OpenRA.Mods.Common.Scripting
throw new LuaException("Invalid ammopool name {0} queried on actor {1}.".F(poolName, self));
if (amount > 0)
{
while (amount-- > 0)
if (!pool.GiveAmmo())
return;
}
pool.GiveAmmo(self, amount);
else
{
while (amount++ < 0)
if (!pool.TakeAmmo())
return;
}
pool.TakeAmmo(self, -amount);
}
}
}