mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-10 20:46:39 +03:00
Actor health must be above to 0 for NPC to count
This commit is contained in:
parent
c741591a36
commit
abd757f3bc
1 changed files with 34 additions and 30 deletions
|
@ -1,24 +1,25 @@
|
||||||
/*
|
/*
|
||||||
===========================================================================
|
===========================================================================
|
||||||
Copyright (C) 1999-2005 Id Software, Inc.
|
Copyright (C) 2023 the OpenMoHAA team
|
||||||
|
|
||||||
This file is part of Quake III Arena source code.
|
This file is part of OpenMoHAA source code.
|
||||||
|
|
||||||
Quake III Arena source code is free software; you can redistribute it
|
OpenMoHAA source code is free software; you can redistribute it
|
||||||
and/or modify it under the terms of the GNU General Public License as
|
and/or modify it under the terms of the GNU General Public License as
|
||||||
published by the Free Software Foundation; either version 2 of the License,
|
published by the Free Software Foundation; either version 2 of the License,
|
||||||
or (at your option) any later version.
|
or (at your option) any later version.
|
||||||
|
|
||||||
Quake III Arena source code is distributed in the hope that it will be
|
OpenMoHAA source code is distributed in the hope that it will be
|
||||||
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with Quake III Arena source code; if not, write to the Free Software
|
along with OpenMoHAA source code; if not, write to the Free Software
|
||||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
===========================================================================
|
===========================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "g_local.h"
|
#include "g_local.h"
|
||||||
|
@ -667,10 +668,7 @@ void G_RunFrame(int levelTime, int frameTime)
|
||||||
if (edict->entity->IsSubclassOfActor()) {
|
if (edict->entity->IsSubclassOfActor()) {
|
||||||
actor = static_cast<Actor *>(edict->entity);
|
actor = static_cast<Actor *>(edict->entity);
|
||||||
|
|
||||||
if (actor->health) {
|
if (actor->health > 0) {
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (actor->m_Team == TEAM_AMERICAN) {
|
if (actor->m_Team == TEAM_AMERICAN) {
|
||||||
numAllies++;
|
numAllies++;
|
||||||
if (actor->m_bDoAI) {
|
if (actor->m_bDoAI) {
|
||||||
|
@ -684,8 +682,14 @@ void G_RunFrame(int levelTime, int frameTime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gi.locationprintf(&g_entities[0], 94, 28, va("NPCS: Allies %d(%d) Axis %d(%d)", numActiveAllies, numAllies, numActiveAxis, numAxis));
|
gi.locationprintf(
|
||||||
|
&g_entities[0],
|
||||||
|
94,
|
||||||
|
28,
|
||||||
|
va("NPCS: Allies %d(%d) Axis %d(%d)", numActiveAllies, numAllies, numActiveAxis, numAxis)
|
||||||
|
);
|
||||||
g_shownpc->integer = 60;
|
g_shownpc->integer = 60;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -737,7 +741,8 @@ void G_ClientDrawBoundingBoxes(void)
|
||||||
G_ClientDrawTags
|
G_ClientDrawTags
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void G_ClientDrawTags(void) {
|
void G_ClientDrawTags(void)
|
||||||
|
{
|
||||||
// FIXME: unimplemented
|
// FIXME: unimplemented
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1709,8 +1714,7 @@ void G_ExitLevel(void)
|
||||||
// Stay on the same map since no nextmap was set
|
// Stay on the same map since no nextmap was set
|
||||||
Com_sprintf(command, sizeof(command), "restart\n");
|
Com_sprintf(command, sizeof(command), "restart\n");
|
||||||
gi.SendConsoleCommand(command);
|
gi.SendConsoleCommand(command);
|
||||||
}
|
} else if (level.nextmap == level.mapname) {
|
||||||
else if (level.nextmap == level.mapname) {
|
|
||||||
// Stay on the same map if it's the same as the current map
|
// Stay on the same map if it's the same as the current map
|
||||||
Com_sprintf(command, sizeof(command), "restart\n");
|
Com_sprintf(command, sizeof(command), "restart\n");
|
||||||
gi.SendConsoleCommand(command);
|
gi.SendConsoleCommand(command);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue