First working compilation.

This commit is contained in:
Julian
2020-02-25 21:46:51 -03:00
parent 6cdc2ea18c
commit f2d8d91baf
88 changed files with 1959 additions and 13767 deletions

2
src/dlls/.gitignore vendored
View File

@@ -1,3 +1,5 @@
msgs/
opt.*/
debug.*/
*.o
*.so

View File

@@ -1,6 +1,9 @@
CPP = gcc
BASEFLAGS = -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp
CPPFLAGS = ${BASEFLAGS} -m386 -O2 -w -I. -I../engine -I../common -I../pm_shared -I../../metamod
# COMPILE ONLY WITH GCC 4.8!
CPP = g++
BASEFLAGS = -Dstricmp=strcasecmp -Dstrcmpi=strcasecmp -m32
OPTFLAGS = -O2
CPPFLAGS = ${BASEFLAGS} ${OPTFLAGS} -w -I. -I../engine -I../common -I../pm_shared -I../metamod
OBJ = \
agrunt.o \
@@ -42,7 +45,7 @@ OBJ = \
zombie.o
monster_mm_i386.so: ${OBJ}
${CPP} -fPIC -shared -o $@ ${OBJ}
${CPP} -m32 -fPIC -shared -o $@ ${OBJ}
clean:
-rm -f *.o

View File

@@ -315,6 +315,7 @@ int GetAnimationEvent( void *pmodel, entvars_t *pev, MonsterEvent_t *pMonsterEve
float SetController( void *pmodel, entvars_t *pev, int iController, float flValue )
{
studiohdr_t *pstudiohdr;
int i;
pstudiohdr = (studiohdr_t *)pmodel;
if (! pstudiohdr)
@@ -323,7 +324,7 @@ float SetController( void *pmodel, entvars_t *pev, int iController, float flValu
mstudiobonecontroller_t *pbonecontroller = (mstudiobonecontroller_t *)((byte *)pstudiohdr + pstudiohdr->bonecontrollerindex);
// find first controller that matches the index
for (int i = 0; i < pstudiohdr->numbonecontrollers; i++, pbonecontroller++)
for (i = 0; i < pstudiohdr->numbonecontrollers; i++, pbonecontroller++)
{
if (pbonecontroller->index == iController)
break;

View File

@@ -53,19 +53,19 @@ void CMApache :: Spawn( void )
if (pev->spawnflags & SF_WAITFORTRIGGER)
{
SetUse( StartupUse );
SetUse( &CMApache::StartupUse );
}
else
{
SetThink( HuntThink );
SetTouch( FlyTouch );
SetThink( &CMApache::HuntThink );
SetTouch( &CMApache::FlyTouch );
pev->nextthink = gpGlobals->time + 1.0;
}
m_iRockets = 10;
m_pBeam = NULL;
m_pGoalEnt = NULL;
m_pGoalEnt = NULL;
m_flGoalSpeed = 0.0f;
m_flForce = 0.0f;
@@ -122,8 +122,8 @@ void CMApache::NullThink( void )
void CMApache::StartupUse( edict_t *pActivator, edict_t *pCaller, USE_TYPE useType, float value )
{
SetThink( HuntThink );
SetTouch( FlyTouch );
SetThink( &CMApache::HuntThink );
SetTouch( &CMApache::FlyTouch );
pev->nextthink = gpGlobals->time + 0.1;
SetUse( NULL );
}
@@ -136,8 +136,8 @@ void CMApache :: Killed( entvars_t *pevAttacker, int iGib )
STOP_SOUND( ENT(pev), CHAN_STATIC, "apache/ap_rotor2.wav" );
UTIL_SetSize( pev, Vector( -32, -32, -64), Vector( 32, 32, 0) );
SetThink( DyingThink );
SetTouch( CrashTouch );
SetThink( &CMApache::DyingThink );
SetTouch( &CMApache::CrashTouch );
pev->nextthink = gpGlobals->time + 0.1;
pev->health = 0;
pev->takedamage = DAMAGE_NO;
@@ -346,7 +346,7 @@ jlb*/
WRITE_BYTE( BREAK_METAL );
MESSAGE_END();
SetThink( SUB_Remove );
SetThink( &CMApache::SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1;
}
}
@@ -899,8 +899,8 @@ void CMApacheHVR :: Spawn( void )
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
UTIL_SetOrigin( pev, pev->origin );
SetThink( IgniteThink );
SetTouch( ExplodeTouch );
SetThink( &CMApacheHVR::IgniteThink );
SetTouch( &CMApacheHVR::ExplodeTouch );
UTIL_MakeAimVectors( pev->angles );
m_vecForward = gpGlobals->v_forward;
@@ -946,7 +946,7 @@ void CMApacheHVR :: IgniteThink( void )
MESSAGE_END(); // move PHS/PVS data sending into here (SEND_ALL, SEND_PVS, SEND_PHS)
// set to accelerate
SetThink( AccelerateThink );
SetThink( &CMApacheHVR::AccelerateThink );
pev->nextthink = gpGlobals->time + 0.1;
}

View File

@@ -20,7 +20,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
#include "decals.h"
@@ -1141,7 +1141,7 @@ CMBMortar *CMBMortar::Shoot( edict_t *pOwner, Vector vecStart, Vector vecVelocit
pSpit->pev->velocity = vecVelocity;
pSpit->pev->owner = pOwner;
pSpit->pev->scale = 2.5;
pSpit->SetThink ( Animate );
pSpit->SetThink ( &CMBMortar::Animate );
pSpit->pev->nextthink = gpGlobals->time + 0.1;
}
return pSpit;

View File

@@ -19,7 +19,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
#include "nodes.h"
@@ -111,9 +111,9 @@ void CSquidSpit::Shoot( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity
pSpit->pev->velocity = vecVelocity;
pSpit->pev->owner = ENT(pevOwner);
pSpit->SetThink ( Animate );
pSpit->SetThink ( &CSquidSpit::Animate );
pSpit->pev->nextthink = gpGlobals->time + 0.1;
pSpit->SetTouch ( SpitTouch );
pSpit->SetTouch ( &CSquidSpit::SpitTouch );
}
void CSquidSpit :: SpitTouch ( edict_t *pOther )
@@ -168,7 +168,7 @@ void CSquidSpit :: SpitTouch ( edict_t *pOther )
}
}
SetThink ( SUB_Remove );
SetThink ( &CSquidSpit::SUB_Remove );
pev->nextthink = gpGlobals->time;
}

View File

@@ -483,7 +483,7 @@ public:
BOOL FValidateHintType ( short sHint );
BOOL FCanActiveIdle ( void );
Schedule_t *GetScheduleOfType ( int Type );
Schedule_t *CMHoundeye :: GetSchedule( void );
Schedule_t *GetSchedule( void );
CUSTOM_SCHEDULES;

View File

@@ -113,7 +113,7 @@ void CMGib :: SpawnStickyGibs( entvars_t *pevVictim, Vector vecOrigin, int cGibs
pGib->pev->movetype = MOVETYPE_TOSS;
pGib->pev->solid = SOLID_BBOX;
UTIL_SetSize ( pGib->pev, Vector ( 0, 0 ,0 ), Vector ( 0, 0, 0 ) );
pGib->SetTouch ( StickyGibTouch );
pGib->SetTouch ( &CMGib::StickyGibTouch );
pGib->SetThink (NULL);
}
pGib->LimitVelocity();
@@ -327,7 +327,7 @@ void CMBaseMonster :: GibMonster( void )
if ( gibbed )
{
// don't remove players!
SetThink ( SUB_Remove );
SetThink ( &CMBaseMonster::SUB_Remove );
pev->nextthink = gpGlobals->time;
}
else
@@ -655,7 +655,7 @@ void CMBaseEntity :: SUB_StartFadeOut ( void )
pev->avelocity = g_vecZero;
pev->nextthink = gpGlobals->time + 0.1;
SetThink ( SUB_FadeOut );
SetThink ( &CMBaseEntity::SUB_FadeOut );
}
void CMBaseEntity :: SUB_FadeOut ( void )
@@ -669,7 +669,7 @@ void CMBaseEntity :: SUB_FadeOut ( void )
{
pev->renderamt = 0;
pev->nextthink = gpGlobals->time + 0.2;
SetThink ( SUB_Remove );
SetThink ( &CMBaseEntity::SUB_Remove );
}
}
@@ -689,7 +689,7 @@ void CMGib :: WaitTillLand ( void )
if ( pev->velocity == g_vecZero )
{
SetThink (SUB_StartFadeOut);
SetThink ( &CMGib::SUB_StartFadeOut );
pev->nextthink = gpGlobals->time + m_lifeTime;
}
else
@@ -740,7 +740,7 @@ void CMGib :: StickyGibTouch ( edict_t *pOther )
Vector vecSpot;
TraceResult tr;
SetThink ( SUB_Remove );
SetThink ( &CMGib::SUB_Remove );
pev->nextthink = gpGlobals->time + 5;
if (!FStrEq(STRING(pOther->v.classname), "worldspawn"))
@@ -781,8 +781,8 @@ void CMGib :: Spawn( const char *szGibModel )
pev->nextthink = gpGlobals->time + 4;
m_lifeTime = 10;
SetThink ( WaitTillLand );
SetTouch ( BounceGibTouch );
SetThink ( &CMGib::WaitTillLand );
SetTouch ( &CMGib::BounceGibTouch );
m_material = matNone;
m_cBloodDecals = 5;// how many blood decals this gib can place (1 per bounce until none remain).

View File

@@ -21,7 +21,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "effects.h"
#include "schedule.h"
@@ -1104,8 +1104,8 @@ void CMControllerHeadBall :: Spawn( void )
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
UTIL_SetOrigin( pev, pev->origin );
SetThink( HuntThink );
SetTouch( BounceTouch );
SetThink( &CMControllerHeadBall::HuntThink );
SetTouch( &CMControllerHeadBall::BounceTouch );
m_vecIdeal = Vector( 0, 0, 0 );
@@ -1198,7 +1198,7 @@ void CMControllerHeadBall :: HuntThink( void )
m_flNextAttack = gpGlobals->time + 3.0;
SetThink( DieThink );
SetThink( &CMControllerHeadBall::DieThink );
pev->nextthink = gpGlobals->time + 0.3;
}
@@ -1291,8 +1291,8 @@ void CMControllerZapBall :: Spawn( void )
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
UTIL_SetOrigin( pev, pev->origin );
SetThink( AnimateThink );
SetTouch( ExplodeTouch );
SetThink( &CMControllerZapBall::AnimateThink );
SetTouch( &CMControllerZapBall::ExplodeTouch );
m_hOwner = pev->owner;
pev->dmgtime = gpGlobals->time; // keep track of when ball spawned

View File

@@ -18,7 +18,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
#include "defaultai.h"

File diff suppressed because it is too large Load Diff

View File

@@ -366,7 +366,7 @@ void CMSprite::Expand( float scaleSpeed, float fadeSpeed )
{
pev->speed = scaleSpeed;
pev->health = fadeSpeed;
SetThink( ExpandThink );
SetThink( &CMSprite::ExpandThink );
pev->nextthink = gpGlobals->time;
m_lastTime = gpGlobals->time;
@@ -421,7 +421,7 @@ void CMSprite::TurnOn( void )
pev->effects = 0;
if ( (pev->framerate && m_maxFrame > 1.0) || (pev->spawnflags & SF_SPRITE_ONCE) )
{
SetThink( AnimateThink );
SetThink( &CMSprite::AnimateThink );
pev->nextthink = gpGlobals->time;
m_lastTime = gpGlobals->time;
}

View File

@@ -79,7 +79,7 @@ public:
inline void AnimateAndDie( float framerate )
{
SetThink(AnimateUntilDead);
SetThink(&CMSprite::AnimateUntilDead);
pev->framerate = framerate;
pev->dmgtime = gpGlobals->time + (m_maxFrame / framerate);
pev->nextthink = gpGlobals->time;
@@ -165,7 +165,7 @@ public:
static CMBeam *BeamCreate( const char *pSpriteName, int width );
inline void LiveForTime( float time ) { SetThink(SUB_Remove); pev->nextthink = gpGlobals->time + time; }
inline void LiveForTime( float time ) { SetThink(&CMBeam::SUB_Remove); pev->nextthink = gpGlobals->time + time; }
inline void BeamDamageInstant( TraceResult *ptr, float damage )
{
pev->dmg = damage;

View File

@@ -49,13 +49,7 @@ typedef int BOOL;
#define MAX_PATH PATH_MAX
#include <limits.h>
#include <stdarg.h>
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d)
#endif
#endif //_WIN32
// Misc C-runtime library headers
@@ -63,6 +57,11 @@ typedef int BOOL;
#include "stdlib.h"
#include "math.h"
// min/max is not on math.h library
// move outside win32 scope so it can compile on both platforms
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
// Header file containing definition of globalvars_t and entvars_t
typedef int func_t; //
typedef int string_t; // from engine's pr_comp.h;

View File

@@ -110,7 +110,7 @@ void CMGrenade::Explode( TraceResult *pTrace, int bitsDamageType )
}
pev->effects |= EF_NODRAW;
SetThink( Smoke );
SetThink( &CMGrenade::Smoke );
pev->velocity = g_vecZero;
pev->nextthink = gpGlobals->time + 0.3;
@@ -155,13 +155,13 @@ void CMGrenade::Killed( entvars_t *pevAttacker, int iGib )
// Timed grenade, this think is called when time runs out.
void CMGrenade::DetonateUse( edict_t *pActivator, edict_t *pCaller, USE_TYPE useType, float value )
{
SetThink( Detonate );
SetThink( &CMGrenade::Detonate );
pev->nextthink = gpGlobals->time;
}
void CMGrenade::PreDetonate( void )
{
SetThink( Detonate );
SetThink( &CMGrenade::Detonate );
pev->nextthink = gpGlobals->time + 1;
}
@@ -329,7 +329,7 @@ void CMGrenade :: TumbleThink( void )
if (pev->dmgtime <= gpGlobals->time)
{
SetThink( Detonate );
SetThink( &CMGrenade::Detonate );
}
if (pev->waterlevel != 0)
{
@@ -370,14 +370,14 @@ CMGrenade *CMGrenade::ShootContact( entvars_t *pevOwner, Vector vecStart, Vector
pGrenade->pev->owner = ENT(pevOwner);
// make monsters afaid of it while in the air
pGrenade->SetThink( DangerSoundThink );
pGrenade->SetThink( &CMGrenade::DangerSoundThink );
pGrenade->pev->nextthink = gpGlobals->time;
// Tumble in air
pGrenade->pev->avelocity.x = RANDOM_FLOAT ( -100, -500 );
// Explode on contact
pGrenade->SetTouch( ExplodeTouch );
pGrenade->SetTouch( &CMGrenade::ExplodeTouch );
pGrenade->pev->dmg = gSkillData.monDmgM203Grenade;
@@ -398,14 +398,14 @@ CMGrenade * CMGrenade:: ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector
pGrenade->pev->angles = UTIL_VecToAngles(pGrenade->pev->velocity);
pGrenade->pev->owner = ENT(pevOwner);
pGrenade->SetTouch( BounceTouch ); // Bounce if touched
pGrenade->SetTouch( &CMGrenade::BounceTouch ); // Bounce if touched
// Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate
// will insert a DANGER sound into the world sound list and delay detonation for one second so that
// the grenade explodes after the exact amount of time specified in the call to ShootTimed().
pGrenade->pev->dmgtime = gpGlobals->time + time;
pGrenade->SetThink( TumbleThink );
pGrenade->SetThink( &CMGrenade::TumbleThink );
pGrenade->pev->nextthink = gpGlobals->time + 0.1;
if (time < 0.1)
{
@@ -452,9 +452,9 @@ CMGrenade * CMGrenade :: ShootSatchelCharge( entvars_t *pevOwner, Vector vecStar
pGrenade->pev->owner = ENT(pevOwner);
// Detonate in "time" seconds
pGrenade->SetThink( SUB_DoNothing );
pGrenade->SetUse( DetonateUse );
pGrenade->SetTouch( SlideTouch );
pGrenade->SetThink( &CMGrenade::SUB_DoNothing );
pGrenade->SetUse( &CMGrenade::DetonateUse );
pGrenade->SetTouch( &CMGrenade::SlideTouch );
pGrenade->pev->spawnflags = SF_DETONATE;
pGrenade->pev->friction = 0.9;

View File

@@ -21,7 +21,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
#include "weapons.h"

View File

@@ -19,7 +19,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
@@ -349,7 +349,7 @@ void CMHeadCrab :: StartTask ( Task_t *pTask )
{
EMIT_SOUND_DYN( edict(), CHAN_WEAPON, pAttackSounds[0], GetSoundVolue(), ATTN_IDLE, 0, GetVoicePitch() );
m_IdealActivity = ACT_RANGE_ATTACK1;
SetTouch ( LeapTouch );
SetTouch ( &CMHeadCrab::LeapTouch );
break;
}
default:

View File

@@ -32,7 +32,7 @@
#include "plane.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
#include "animation.h"

View File

@@ -19,7 +19,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "weapons.h"
#include "hornet.h"
@@ -71,8 +71,8 @@ void CMHornet :: Spawn( void )
SET_MODEL(ENT( pev ), "models/hornet.mdl");
UTIL_SetSize( pev, Vector( -4, -4, -4 ), Vector( 4, 4, 4 ) );
SetTouch( DieTouch );
SetThink( StartTrack );
SetTouch( &CMHornet::DieTouch );
SetThink( &CMHornet::StartTrack );
edict_t *pSoundEnt = pev->owner;
if ( !pSoundEnt )
@@ -140,8 +140,8 @@ void CMHornet :: StartTrack ( void )
{
IgniteTrail();
SetTouch( TrackTouch );
SetThink( TrackTarget );
SetTouch( &CMHornet::TrackTouch );
SetThink( &CMHornet::TrackTarget );
pev->nextthink = gpGlobals->time + 0.1;
}
@@ -153,9 +153,9 @@ void CMHornet :: StartDart ( void )
{
IgniteTrail();
SetTouch( DartTouch );
SetTouch( &CMHornet::DartTouch );
SetThink( SUB_Remove );
SetThink( &CMHornet::SUB_Remove );
pev->nextthink = gpGlobals->time + 4;
}
@@ -228,7 +228,7 @@ void CMHornet :: TrackTarget ( void )
if (gpGlobals->time > m_flStopAttack)
{
SetTouch( NULL );
SetThink( SUB_Remove );
SetThink( &CMHornet::SUB_Remove );
pev->nextthink = gpGlobals->time + 0.1;
return;
}
@@ -366,7 +366,7 @@ void CMHornet::DieTouch ( edict_t *pOther )
pev->modelindex = 0;// so will disappear for the 0.1 secs we wait until NEXTTHINK gets rid
pev->solid = SOLID_NOT;
SetThink ( SUB_Remove );
SetThink ( &CMHornet::SUB_Remove );
pev->nextthink = gpGlobals->time + 1;// stick around long enough for the sound to finish!
}

View File

@@ -19,7 +19,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
#include "animation.h"

View File

@@ -19,7 +19,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
#include "effects.h"

View File

@@ -90,13 +90,13 @@ bool scan_monster_cfg(FILE *fp)
{
if (origin)
{
META_CONS("[MONSTER] ERROR: origin found twice: %s", input);
//META_CONS("[MONSTER] ERROR: origin found twice: %s", input);
LOG_MESSAGE(PLID, "ERROR: origin found twice: %s", input);
return TRUE; // error
}
if (sscanf(&input[7], "%f %f %f", &x, &y, &z) != 3)
{
META_CONS("[MONSTER] ERROR: invalid origin: %s", input);
//META_CONS("[MONSTER] ERROR: invalid origin: %s", input);
LOG_MESSAGE(PLID, "ERROR: invalid origin: %s", input);
return TRUE; // error
}
@@ -109,13 +109,13 @@ bool scan_monster_cfg(FILE *fp)
{
if (delay)
{
META_CONS("[MONSTER] ERROR: delay found twice: %s", input);
//META_CONS("[MONSTER] ERROR: delay found twice: %s", input);
LOG_MESSAGE(PLID, "ERROR: delay found twice: %s", input);
return TRUE; // error
}
if (sscanf(&input[6], "%f", &x) != 1)
{
META_CONS("[MONSTER] ERROR: invalid delay: %s", input);
//META_CONS("[MONSTER] ERROR: invalid delay: %s", input);
LOG_MESSAGE(PLID, "ERROR: invalid delay: %s", input);
return TRUE; // error
}
@@ -126,19 +126,19 @@ bool scan_monster_cfg(FILE *fp)
{
if (angle)
{
META_CONS("[MONSTER] ERROR: angle found twice: %s", input);
//META_CONS("[MONSTER] ERROR: angle found twice: %s", input);
LOG_MESSAGE(PLID, "ERROR: angle found twice: %s", input);
return TRUE; // error
}
if (angle_min || angle_max)
{
META_CONS("[MONSTER] ERROR: you can't specify angle AND angle_min or angle_max: %s", input);
//META_CONS("[MONSTER] ERROR: you can't specify angle AND angle_min or angle_max: %s", input);
LOG_MESSAGE(PLID, "ERROR: you can't specify angle AND angle_min or angle_max: %s", input);
return TRUE; // error
}
if (sscanf(&input[6], "%f", &x) != 1)
{
META_CONS("[MONSTER] ERROR: invalid angle: %s", input);
//META_CONS("[MONSTER] ERROR: invalid angle: %s", input);
LOG_MESSAGE(PLID, "ERROR: invalid angle: %s", input);
return TRUE; // error
}
@@ -150,19 +150,19 @@ bool scan_monster_cfg(FILE *fp)
{
if (angle_min)
{
META_CONS("[MONSTER] ERROR: angle_min found twice: %s", input);
//META_CONS("[MONSTER] ERROR: angle_min found twice: %s", input);
LOG_MESSAGE(PLID, "ERROR: angle_min found twice: %s", input);
return TRUE; // error
}
if (angle)
{
META_CONS("[MONSTER] ERROR: you can't specify angle AND angle_min or angle_max: %s", input);
//META_CONS("[MONSTER] ERROR: you can't specify angle AND angle_min or angle_max: %s", input);
LOG_MESSAGE(PLID, "ERROR: you can't specify angle AND angle_min or angle_max: %s", input);
return TRUE; // error
}
if (sscanf(&input[10], "%f", &x) != 1)
{
META_CONS("[MONSTER] ERROR: invalid angle_min: %s", input);
//META_CONS("[MONSTER] ERROR: invalid angle_min: %s", input);
LOG_MESSAGE(PLID, "ERROR: invalid angle_min: %s", input);
return TRUE; // error
}
@@ -173,19 +173,19 @@ bool scan_monster_cfg(FILE *fp)
{
if (angle_max)
{
META_CONS("[MONSTER] ERROR: angle_max found twice: %s", input);
//META_CONS("[MONSTER] ERROR: angle_max found twice: %s", input);
LOG_MESSAGE(PLID, "ERROR: angle_max found twice: %s", input);
return TRUE; // error
}
if (angle)
{
META_CONS("[MONSTER] ERROR: you can't specify angle AND angle_min or angle_max: %s", input);
//META_CONS("[MONSTER] ERROR: you can't specify angle AND angle_min or angle_max: %s", input);
LOG_MESSAGE(PLID, "ERROR: you can't specify angle AND angle_min or angle_max: %s", input);
return TRUE; // error
}
if (sscanf(&input[10], "%f", &x) != 1)
{
META_CONS("[MONSTER] ERROR: invalid angle_max: %s", input);
//META_CONS("[MONSTER] ERROR: invalid angle_max: %s", input);
LOG_MESSAGE(PLID, "ERROR: invalid angle_max: %s", input);
return TRUE; // error
}
@@ -211,7 +211,7 @@ bool scan_monster_cfg(FILE *fp)
}
if (monster_types[index].name[0] == 0)
{
META_CONS("[MONSTER] ERROR: invalid monster name: %s", input);
//META_CONS("[MONSTER] ERROR: invalid monster name: %s", input);
LOG_MESSAGE(PLID, "ERROR: invalid monster name: %s", input);
return TRUE;
}
@@ -220,7 +220,7 @@ bool scan_monster_cfg(FILE *fp)
}
else
{
META_CONS("[MONSTER] ERROR: unknown command: %s", input);
//META_CONS("[MONSTER] ERROR: unknown command: %s", input);
LOG_MESSAGE(PLID, "ERROR: unknown command: %s", input);
return TRUE; // error occurred
}
@@ -229,25 +229,25 @@ bool scan_monster_cfg(FILE *fp)
// check for all necessary fields here...
if (!origin)
{
META_CONS("[MONSTER] ERROR: you didn't specify an origin!");
//META_CONS("[MONSTER] ERROR: you didn't specify an origin!");
LOG_MESSAGE(PLID, "ERROR: you didn't specify an origin!");
return TRUE;
}
if (angle_min && !angle_max)
{
META_CONS("[MONSTER] ERROR: you specified angle_min but didn't specify angle_max!");
//META_CONS("[MONSTER] ERROR: you specified angle_min but didn't specify angle_max!");
LOG_MESSAGE(PLID, "ERROR: you specified angle_min but didn't specify angle_max!");
return TRUE;
}
if (angle_max && !angle_min)
{
META_CONS("[MONSTER] ERROR: you specified angle_max but didn't specify angle_min!");
//META_CONS("[MONSTER] ERROR: you specified angle_max but didn't specify angle_min!");
LOG_MESSAGE(PLID, "ERROR: you specified angle_max but didn't specify angle_min!");
return TRUE;
}
if (!monster)
{
META_CONS("[MONSTER] ERROR: No monster key found!");
//META_CONS("[MONSTER] ERROR: No monster key found!");
LOG_MESSAGE(PLID, "ERROR: No monster key found!");
return TRUE;
}
@@ -328,13 +328,13 @@ bool process_monster_cfg(void)
{
if (dllapi_log->value)
{
META_CONS("[MONSTER] Processing config file=%s", filename);
//META_CONS("[MONSTER] Processing config file=%s", filename);
LOG_MESSAGE(PLID, "Processing config file=%s", filename);
}
if ((fp = fopen(filename, "r")) == NULL)
{
META_CONS("[MONSTER] ERROR: Could not open \"%s\"!", filename);
//META_CONS("[MONSTER] ERROR: Could not open \"%s\"!", filename);
LOG_MESSAGE(PLID, "ERROR: Could not open \"%s\" file!", filename);
return TRUE; // return bad status
@@ -370,7 +370,7 @@ bool scan_monster_precache_cfg(FILE *fp)
if (found == FALSE)
{
META_CONS("[MONSTER] ERROR: invalid precache monster name: %s", input);
//META_CONS("[MONSTER] ERROR: invalid precache monster name: %s", input);
LOG_MESSAGE(PLID, "ERROR: invalid precache monster name: %s", input);
}
}
@@ -397,13 +397,13 @@ bool process_monster_precache_cfg(void)
{
if (dllapi_log->value)
{
META_CONS("[MONSTER] Processing config file=%s", filename);
//META_CONS("[MONSTER] Processing config file=%s", filename);
LOG_MESSAGE(PLID, "Processing config file=%s", filename);
}
if ((fp = fopen(filename, "r")) == NULL)
{
META_CONS("[MONSTER] ERROR: Could not open \"%s\"!", filename);
//META_CONS("[MONSTER] ERROR: Could not open \"%s\"!", filename);
LOG_MESSAGE(PLID, "ERROR: Could not open \"%s\" file!", filename);
return TRUE; // return bad status

View File

@@ -1629,9 +1629,9 @@ void CMBaseMonster :: MonsterInit ( void )
// set eye position
SetEyePosition();
SetThink( MonsterInitThink );
SetThink( &CMBaseMonster::MonsterInitThink );
pev->nextthink = gpGlobals->time + 0.1;
SetUse ( MonsterUse );
SetUse ( &CMBaseMonster::MonsterUse );
}
//=========================================================
@@ -1733,7 +1733,7 @@ void CMBaseMonster :: StartMonster ( void )
// Delay drop to floor to make sure each door in the level has had its chance to spawn
// Spread think times so that they don't all happen at the same time (Carmack)
SetThink ( CallMonsterThink );
SetThink ( &CMBaseMonster::CallMonsterThink );
pev->nextthink += RANDOM_FLOAT(0.1, 0.4); // spread think times.
if ( !FStringNull(pev->targetname) )// wait until triggered
@@ -2770,7 +2770,7 @@ void CMBaseMonster :: MonsterInitDead( void )
// Setup health counters, etc.
BecomeDead();
SetThink( CorpseFallThink );
SetThink( &CMBaseMonster::CorpseFallThink );
pev->nextthink = gpGlobals->time + 0.5;
}

View File

@@ -19,12 +19,19 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "nodes.h"
#include "animation.h"
#include "doors.h"
//#if !defined ( _WIN32 )
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h> // mkdir
//#endif
#define HULL_STEP_SIZE 16// how far the test hull moves on each step
#define NODE_HEIGHT 8 // how high to lift nodes off the ground after we drop them all (make stair/ramp mapping easier)
@@ -610,7 +617,8 @@ int CGraph :: FindShortestPath ( int *piPath, int iStart, int iDest, int iHull,
// Mark all the nodes as unvisited.
//
for ( int i = 0; i < m_cNodes; i++)
int i;
for ( i = 0; i < m_cNodes; i++)
{
m_pNodes[ i ].m_flClosestSoFar = -1.0;
}
@@ -1411,12 +1419,12 @@ void CTestHull :: Spawn( entvars_t *pevMasterNode )
if ( WorldGraph.m_fGraphPresent )
{// graph loaded from disk, so we don't need the test hull
SetThink ( SUB_Remove );
SetThink ( &CTestHull::SUB_Remove );
pev->nextthink = gpGlobals->time;
}
else
{
SetThink ( DropDelay );
SetThink ( &CTestHull::DropDelay );
pev->nextthink = gpGlobals->time + 1;
}
@@ -1436,7 +1444,7 @@ void CTestHull::DropDelay ( void )
UTIL_SetOrigin ( VARS(pev), WorldGraph.m_pNodes[ 0 ].m_vecOrigin );
SetThink ( CallBuildNodeGraph );
SetThink ( &CTestHull::CallBuildNodeGraph );
pev->nextthink = gpGlobals->time + 1;
}
@@ -1584,7 +1592,7 @@ void CTestHull :: BuildNodeGraph( void )
float flDist;
int step;
SetThink ( SUB_Remove );// no matter what happens, the hull gets rid of itself.
SetThink ( &CTestHull::SUB_Remove );// no matter what happens, the hull gets rid of itself.
pev->nextthink = gpGlobals->time;
// malloc a swollen temporary connection pool that we trim down after we know exactly how many connections there are.
@@ -1696,7 +1704,7 @@ void CTestHull :: BuildNodeGraph( void )
{
ALERT ( at_aiconsole, "**ConnectVisibleNodes FAILED!\n" );
SetThink ( ShowBadNode );// send the hull off to show the offending node.
SetThink ( &CTestHull::ShowBadNode );// send the hull off to show the offending node.
//pev->solid = SOLID_NOT;
pev->origin = WorldGraph.m_pNodes[ iBadNode ].m_vecOrigin;
@@ -2685,7 +2693,9 @@ void CGraph::HashChoosePrimes(int TableSize)
// We divide this interval into 16 equal sized zones. We want to find
// one prime number that best represents that zone.
//
for (int iZone = 1, iPrime = 0; iPrime < 16; iZone += Spacing)
int iPrime;
int iZone;
for (iZone = 1, iPrime = 0; iPrime < 16; iZone += Spacing)
{
// Search for a prime number that is less than the target zone
// number given by iZone.
@@ -2742,8 +2752,9 @@ void CGraph::SortNodes(void)
// things and patchup the links.
//
int iNodeCnt = 0;
int i;
m_pNodes[0].m_iPreviousNode = iNodeCnt++;
for (int i = 1; i < m_cNodes; i++)
for (i = 1; i < m_cNodes; i++)
{
m_pNodes[i].m_iPreviousNode = UNNUMBERED_NODE;
}
@@ -2808,7 +2819,8 @@ void CGraph::BuildLinkLookups(void)
ALERT(at_aiconsole, "Couldn't allocated Link Lookup Table.\n");
return;
}
for (int i = 0; i < m_nHashLinks; i++)
int i;
for (i = 0; i < m_nHashLinks; i++)
{
m_pHashLinks[i] = ENTRY_STATE_EMPTY;
}
@@ -2848,7 +2860,8 @@ void CGraph::BuildRegionTables(void)
// Calculate regions for all the nodes.
//
//
for (int i = 0; i < 3; i++)
int i;
for (i = 0; i < 3; i++)
{
m_RegionMin[i] = 999999999.0; // just a big number out there;
m_RegionMax[i] = -999999999.0; // just a big number out there;
@@ -2875,10 +2888,11 @@ void CGraph::BuildRegionTables(void)
m_pNodes[i].m_Region[1] = CALC_RANGE(m_pNodes[i].m_vecOrigin.y, m_RegionMin[1], m_RegionMax[1]);
m_pNodes[i].m_Region[2] = CALC_RANGE(m_pNodes[i].m_vecOrigin.z, m_RegionMin[2], m_RegionMax[2]);
}
for (i = 0; i < 3; i++)
{
for (int j = 0; j < NUM_RANGES; j++)
int j;
for (j = 0; j < NUM_RANGES; j++)
{
m_RangeStart[i][j] = 255;
m_RangeEnd[i][j] = 0;
@@ -3012,7 +3026,8 @@ void CGraph :: ComputeStaticRoutingTables( void )
// Initialize Routing table to uncalculated.
//
for (int iFrom = 0; iFrom < m_cNodes; iFrom++)
int iFrom;
for (iFrom = 0; iFrom < m_cNodes; iFrom++)
{
for (int iTo = 0; iTo < m_cNodes; iTo++)
{
@@ -3228,7 +3243,8 @@ void CGraph :: ComputeStaticRoutingTables( void )
int nRoute = p - pRoute;
if (m_pRouteInfo)
{
for (int i = 0; i < m_nRouteInfo - nRoute; i++)
int i;
for (i = 0; i < m_nRouteInfo - nRoute; i++)
{
if (memcmp(m_pRouteInfo + i, pRoute, nRoute) == 0)
{
@@ -3320,7 +3336,8 @@ void CGraph :: TestRoutingTables( void )
//
#if 1
float flDistance1 = 0.0;
for (int i = 0; i < cPathSize1-1; i++)
int i;
for (i = 0; i < cPathSize1-1; i++)
{
// Find the link from pMyPath[i] to pMyPath[i+1]
//

View File

@@ -19,7 +19,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
#include "defaultai.h"

View File

@@ -114,7 +114,7 @@ void scan_monster_skill(FILE *fp)
if (!found)
{
META_CONS("[MONSTER] ERROR: unknown monster_skill.cfg item: %s", input);
//META_CONS("[MONSTER] ERROR: unknown monster_skill.cfg item: %s", input);
LOG_MESSAGE(PLID, "ERROR: unknown monster_skill.cfg item: %s", input);
}
}
@@ -231,13 +231,13 @@ void monster_skill_init(void)
{
if (dllapi_log->value)
{
META_CONS("[MONSTER] Processing monster skill file=%s", filename);
//META_CONS("[MONSTER] Processing monster skill file=%s", filename);
LOG_MESSAGE(PLID, "Processing monster skill file=%s", filename);
}
if ((fp = fopen(filename, "r")) == NULL)
{
META_CONS("[MONSTER] ERROR: Could not open \"%s\"!", filename);
//META_CONS("[MONSTER] ERROR: Could not open \"%s\"!", filename);
LOG_MESSAGE(PLID, "ERROR: Could not open \"%s\"!", filename);
}
@@ -247,7 +247,7 @@ void monster_skill_init(void)
}
else
{
META_CONS("[MONSTER] ERROR: Could not find \"%s\" (default skill used)", filename);
//META_CONS("[MONSTER] ERROR: Could not find \"%s\" (default skill used)", filename);
LOG_MESSAGE(PLID, "ERROR: Could not find \"%s\" (default skill used)", filename);
}
}

View File

@@ -24,6 +24,9 @@
#include "cmtalkmonster.h"
#include "pm_materials.h"
//#if !defined ( _WIN32 )
#include <ctype.h>
//#endif
static char *memfgets( byte *pMemFile, int fileSize, int &filePos, char *pBuffer, int bufferSize );

View File

@@ -61,8 +61,8 @@ void CMSqueakGrenade :: Spawn( void )
UTIL_SetSize(pev, Vector( -4, -4, 0), Vector(4, 4, 8));
UTIL_SetOrigin( pev, pev->origin );
SetTouch( SuperBounceTouch );
SetThink( HuntThink );
SetTouch( &CMSqueakGrenade::SuperBounceTouch );
SetThink( &CMSqueakGrenade::HuntThink );
pev->nextthink = gpGlobals->time + 0.1;
m_flNextHunt = gpGlobals->time + 1E6;
@@ -102,7 +102,7 @@ void CMSqueakGrenade::Precache( void )
void CMSqueakGrenade :: Killed( entvars_t *pevAttacker, int iGib )
{
pev->model = iStringNull;// make invisible
SetThink( SUB_Remove );
SetThink( &CMSqueakGrenade::SUB_Remove );
SetTouch( NULL );
pev->nextthink = gpGlobals->time + 0.1;

View File

@@ -177,7 +177,7 @@ void CMBaseDelay :: SUB_UseTargets( edict_t *pActivator, USE_TYPE useType, float
pTemp->pev->nextthink = gpGlobals->time + m_flDelay;
pTemp->SetThink( DelayThink );
pTemp->SetThink( &CMBaseDelay::DelayThink );
// Save the useType
pTemp->pev->button = (int)useType;
@@ -327,7 +327,7 @@ void CMBaseToggle :: LinearMove( Vector vecDest, float flSpeed )
// set nextthink to trigger a call to LinearMoveDone when dest is reached
pev->nextthink = pev->ltime + flTravelTime;
SetThink( LinearMoveDone );
SetThink( &CMBaseToggle::LinearMoveDone );
// scale the destdelta vector by the time spent traveling to get velocity
pev->velocity = vecDestDelta / flTravelTime;
@@ -384,7 +384,7 @@ void CMBaseToggle :: AngularMove( Vector vecDestAngle, float flSpeed )
// set nextthink to trigger a call to AngularMoveDone when dest is reached
pev->nextthink = pev->ltime + flTravelTime;
SetThink( AngularMoveDone );
SetThink( &CMBaseToggle::AngularMoveDone );
// scale the destdelta vector by the time spent traveling to get velocity
pev->avelocity = vecDestDelta / flTravelTime;

View File

@@ -15,7 +15,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"
#include "cmtalkmonster.h"

View File

@@ -178,6 +178,7 @@ typedef enum
} TOGGLE_STATE;
// Misc useful
#include "string.h"
inline BOOL FStrEq(const char*sz1, const char*sz2)
{ return (strcmp(sz1, sz2) == 0); }
inline BOOL FClassnameIs(edict_t* pent, const char* szClassname)

View File

@@ -21,7 +21,7 @@
#include "extdll.h"
#include "util.h"
#include "cmbase.h"
#include "cmbasemonster.h"
#include "cmbasemonster.h"
#include "monsters.h"
#include "schedule.h"