MCPcopy Create free account
hub / github.com/JACoders/OpenJK / SP_point_combat

Function SP_point_combat

code/game/NPC_combat.cpp:2593–2625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2591*/
2592
2593void SP_point_combat( gentity_t *self )
2594{
2595 if(level.numCombatPoints >= MAX_COMBAT_POINTS)
2596 {
2597#ifndef FINAL_BUILD
2598 gi.Printf(S_COLOR_RED"ERROR: Too many combat points, limit is %d\n", MAX_COMBAT_POINTS);
2599#endif
2600 G_FreeEntity(self);
2601 return;
2602 }
2603
2604 self->s.origin[2] += 0.125;
2605 G_SetOrigin(self, self->s.origin);
2606 gi.linkentity(self);
2607
2608 if ( G_CheckInSolid( self, qtrue ) )
2609 {
2610#ifndef FINAL_BUILD
2611 gi.Printf( S_COLOR_RED"ERROR: combat point at %s in solid!\n", vtos(self->currentOrigin) );
2612#endif
2613 }
2614
2615 VectorCopy( self->currentOrigin, level.combatPoints[level.numCombatPoints].origin );
2616
2617 level.combatPoints[level.numCombatPoints].flags = self->spawnflags;
2618 level.combatPoints[level.numCombatPoints].occupied = qfalse;
2619
2620 level.numCombatPoints++;
2621
2622 NAV::SpawnedPoint(self, NAV::PT_COMBATNODE);
2623
2624 G_FreeEntity(self);
2625};
2626
2627void CP_FindCombatPointWaypoints( void )
2628{

Callers

nothing calls this directly

Calls 5

VectorCopyFunction · 0.85
G_FreeEntityFunction · 0.70
G_SetOriginFunction · 0.70
G_CheckInSolidFunction · 0.70
vtosFunction · 0.70

Tested by

no test coverage detected