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

Function MultiDoMSafePowerup

Descent3/multisafe_server.cpp:1125–1145  ·  view source on GitHub ↗

Resolves a powerup that the server is telling us about

Source from the content-addressed store, hash-verified

1123
1124// Resolves a powerup that the server is telling us about
1125void MultiDoMSafePowerup(uint8_t *data) {
1126 int count = 0;
1127 msafe_struct base_mstruct;
1128 msafe_struct *mstruct = &base_mstruct;
1129
1130 SKIP_HEADER(data, &count);
1131 int objnum = MultiGetUshort(data, &count);
1132
1133 mstruct->objhandle = VerifyMSafeObject(objnum);
1134
1135 objnum = MultiGetUshort(data, &count);
1136 mstruct->ithandle = VerifyMSafeObject(objnum);
1137
1138 ASSERT(mstruct->objhandle != -1 && mstruct->ithandle != -1);
1139 if (mstruct->objhandle == -1 || mstruct->ithandle == -1)
1140 return;
1141 object *op = ObjGet(mstruct->objhandle);
1142 ASSERT(op);
1143 if (op && (op->type != OBJ_NONE))
1144 msafe_DoPowerup(mstruct);
1145}
1146
1147// Sends a powerup over to be evaluated on the client machine
1148void MultiSendMSafePowerup(msafe_struct *mstruct) {

Callers 2

MultiProcessDataFunction · 0.85
DemoReadPowerupsFunction · 0.85

Calls 5

SKIP_HEADERFunction · 0.85
MultiGetUshortFunction · 0.85
VerifyMSafeObjectFunction · 0.85
ObjGetFunction · 0.85
msafe_DoPowerupFunction · 0.85

Tested by

no test coverage detected