MCPcopy Create free account
hub / github.com/NBlood/NBlood / DoSpawnSpotsForKill

Function DoSpawnSpotsForKill

source/sw/src/sector.cpp:1243–1269  ·  view source on GitHub ↗

spawns shrap when killing an object

Source from the content-addressed store, hash-verified

1241
1242// spawns shrap when killing an object
1243void
1244DoSpawnSpotsForKill(short match)
1245{
1246 short sn, next_sn;
1247 SPRITEp sp;
1248 USERp u;
1249
1250 if (match < 0)
1251 return;
1252
1253 TRAVERSE_SPRITE_STAT(headspritestat[STAT_SPAWN_SPOT], sn, next_sn)
1254 {
1255 sp = &sprite[sn];
1256
1257 // change the stat num and set the delay correctly to call SpawnShrap
1258 if (sp->hitag == SPAWN_SPOT && sp->lotag == match)
1259 {
1260 u = User[sn];
1261 change_sprite_stat(sn, STAT_NO_STATE);
1262 u->ActorActionFunc = DoSpawnSpot;
1263 u->WaitTics = SP_TAG5(sp) * 15;
1264 setspritez(sn, (vec3_t *)sp);
1265 // setting for Killed
1266 u->LastDamage = 1;
1267 }
1268 }
1269}
1270
1271// spawns shrap when damaging an object
1272void

Callers 3

UserBreakWallFunction · 0.85
TestKillSectorObjectFunction · 0.85
DoMatchEverythingFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestKillSectorObjectFunction · 0.68