Refactoring: Added parameter for container in CreateLiquid()

liquid_container
Mark 2016-03-25 19:44:36 +01:00
parent 52542d7977
commit ab5d92117a
1 changed files with 11 additions and 2 deletions

View File

@ -216,14 +216,23 @@ func RemoveLiquid(string liquid_name, int amount, object destination)
and amount. Liquids with amount 0 can be created
that way.
*/
func CreateLiquid(int amount)
func CreateLiquid(int amount, object in_container)
{
if (GetType(this) != C4V_Def)
{
FatalError("Must be called from definition context!");
}
var item = CreateObject(this);
var item;
if (in_container)
{
item = in_container->CreateContents(this);
}
else
{
item = CreateObject(this);
}
item->SetStackCount(amount);
return item;
}