Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case ACSF_SetInventoryMax:
- if (activator != NULL)
- {
- const char *type = FBehavior::StaticLookupString(args[0]);
- int amount = argCount >= 2? args[1] : -1;
- const PClass *cls = PClass::FindClass(type);
- AInventory *item;
- if (cls != NULL && cls->IsDescendantOf (RUNTIME_CLASS(AInventory)))
- {
- item = activator->FindInventory (cls);
- if (item != NULL)
- {
- item->ItemFlags &= IF_KEEPDEPLETED;
- item->MaxAmount = amount;
- }
- else
- {
- item = activator->GiveInventoryType (cls);
- item->ItemFlags &= IF_KEEPDEPLETED;
- item->MaxAmount = amount;
- item->Amount = 0;
- }
- }
- }
- break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement