MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / ObjAddWeapon

Function ObjAddWeapon

engine/Poseidon/Game/Commands/GameStateExtObj.cpp:1212–1223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1210}
1211
1212GameValue ObjAddWeapon(const GameState* state, GameValuePar oper1, GameValuePar oper2)
1213{
1214 EntityAI* ai = dyn_cast<EntityAI>(GetObject(oper1));
1215 if (!ai)
1216 {
1217 return NOTHING;
1218 }
1219 GameStringType weapon = oper2;
1220 ai->AddWeapon(weapon);
1221 ai->AutoReloadAll();
1222 return NOTHING;
1223}
1224
1225GameValue ObjRemoveWeapon(const GameState* state, GameValuePar oper1, GameValuePar oper2)
1226{

Callers

nothing calls this directly

Calls 3

AutoReloadAllMethod · 0.80
GetObjectFunction · 0.70
AddWeaponMethod · 0.45

Tested by

no test coverage detected