MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / aAddObjectToInventoryNamed

Function aAddObjectToInventoryNamed

scripts/DallasFuncs.cpp:4313–4328  ·  view source on GitHub ↗

$$ACTION Players Add [o:Object] to [o:PlayerObject]'s inventory with name [s:ItemName], Spewable when player dies [b:Spewable=FALSE] aAddObjectToInventoryNamed Adds a specific object to a player's inventory with a custom name Parameters: Object: Object to add PlayerObject: Player to get object ItemName: The name for this object Spewable: Whether the object should be spewed from the invent

Source from the content-addressed store, hash-verified

4311$$END
4312*/
4313void aAddObjectToInventoryNamed(int Object, int PlayerObject, const char *name, bool Spewable) {
4314 msafe_struct mstruct;
4315
4316 mstruct.objhandle = PlayerObject;
4317 mstruct.ithandle = Object;
4318
4319 strncpy(mstruct.message, name, sizeof(mstruct.message) - 1);
4320 mstruct.message[sizeof(mstruct.message) - 1] = '\0';
4321
4322 if (Spewable)
4323 mstruct.flags = 0;
4324 else
4325 mstruct.flags = INVAF_NOTSPEWABLE;
4326
4327 MSafe_CallFunction(MSAFE_INVEN_ADD_OBJECT, &mstruct);
4328}
4329
4330/*
4331$$ACTION

Callers 5

CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85
CallEventMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected