Add support for TARGET_QUAKEWORLD

This commit is contained in:
Marco Cawthorne 2023-06-27 09:53:25 -07:00
parent 5e19510035
commit 0f2b845902
Signed by: eukara
GPG key ID: CE2032F0A2882A22
11 changed files with 385 additions and 177 deletions

97
src/builtins.qh Normal file
View file

@ -0,0 +1,97 @@
/* these are the standard engine builtins */
void makevectors(vector ang) = #1
void setorigin(entity e, vector o) = #2;
void setmodel(entity e, string m) = #3;
void setsize(entity e, vector min, vector max) = #4;
/* 5 was removed */
void break(void) = #6;
float random(void) = #7;
void sound(entity e, float chan, string samp, float vol, float atten) = #8;
vector normalize(vector v) = #9;
void error(string e) = #10;
void objerror(string e) = #11;
float vlen(vector v) = #12;
float vectoyaw(vector v) = #13;
entity spawn(void) = #14;
void remove(entity e) = #15;
void traceline(vector v1, vector v2, float nomonsters, entity forent) = #16;
entity checkclient(void) = #17;
entity find(entity start, .string fld, string match) = #18;
string precache_sound(string s) = #19;
string precache_model(string s) = #20;
void stuffcmd(entity client, string s) = #21;
entity findradius(vector org, float rad) = #22;
#ifndef TARGET_QUAKEWORLD
void bprint(string s) = #23;
void sprint(entity client, string s) = #24;
#else
void(float level, string s) bprint = #23;
void(entity client, float level, string s) sprint = #24;
#endif
void dprint(string s) = #25;
string ftos(float f) = #26;
string vtos(vector v) = #27;
void coredump(void) = #28;
void traceon(void) = #29;
void traceoff(void) = #30;
void eprint(entity e) = #31;
float walkmove(float yaw, float dist) = #32;
/* #33 was removed */
float droptofloor(float yaw, float dist) = #34;
void lightstyle(float style, string value) = #35;
float rint(float v) = #36;
float floor(float v) = #37;
float ceil(float v) = #38;
/* #39 was removed */
float checkbottom(entity e) = #40;
float pointcontents(vector v) = #41;
/* #42 was removed */
float fabs(float f) = #43;
vector aim(entity e, float speed) = #44;
float cvar(string s) = #45;
void localcmd(string s) = #46;
entity nextent(entity e) = #47;
#ifndef TARGET_QUAKEWORLD
void particle(vector o, vector d, float color, float count) = #48;
#endif
void changeyaw(void) = #49;
/* #50 was removed */
vector vectoangles(vector v) = #51;
void writeByte(float to, float f) = #52;
void writeChar(float to, float f) = #53;
void writeShort(float to, float f) = #54;
void writeLong(float to, float f) = #55;
void writeCoord(float to, float f) = #56;
void writeAngle(float to, float f) = #57;
void writeString(float to, string s) = #58;
void writeEntity(float to, entity s) = #59;
/* 60 was removed */
/* 61 was removed */
/* 62 was removed */
/* 63 was removed */
/* 64 was removed */
/* 65 was removed */
/* 66 was removed */
void movetogoal(float step) = #67;
string precache_file(string s) = #68;
void makestatic(entity e) = #69;
void changelevel(string s) = #70;
/* 71 was removed */
void cvar_set(string var, string val) = #72;
void centerprint(entity client, string s) = #73;
void ambientsound(vector pos, string samp, float vol, float atten) = #74;
string precache_model2(string s) = #75;
string precache_sound2(string s) = #76;
string precache_file2(string s) = #77;
void setspawnparms(entity e) = #78;
#ifdef TARGET_QUAKEWORLD
void logfrag(entity killer, entity killee) = #79;
string infokey(entity e, string key) = #80;
float stof(string s) = #81;
void multicast(vector where, float set) = #82;
#endif

View file

@ -1,14 +1,15 @@
//
// constants
//
/* all base engine constants for eithet NetQuake or QuakeWorld */
/* boolean type */
typedef enum
{
FALSE,
TRUE,
false = 0,
true = 1,
FALSE = 0,
TRUE = 1,
} bool;
// edict.flags
/* entity flags */
typedef enumflags
{
FL_FLY, /* is of movetype fly ??? */
@ -26,6 +27,7 @@ typedef enumflags
FL_JUMPRELEASED, /* for jump debouncing */
} flags_t;
/* movement types */
typedef enum
{
MOVETYPE_NONE, /** not moving */
@ -42,6 +44,7 @@ typedef enum
MOVETYPE_BOUNCEMISSILE /** bounce but for projectiles */
} movetype_t;
/* collision types */
typedef enum
{
SOLID_NOT, /* no interaction with other objects */
@ -51,7 +54,7 @@ typedef enum
SOLID_BSP /* bsp clip, touch on edge, block */
} solid_t;
// range values
/* range values */
typedef enum
{
RANGE_MELEE,
@ -60,7 +63,7 @@ typedef enum
RANGE_FAR
} range_t;
// deadflag values
/* deadflag values */
typedef enum
{
DEAD_NO,
@ -69,7 +72,7 @@ typedef enum
DEAD_RESPAWNABLE
} dead_t;
// takedamage values
/* takedamage values */
typedef enum
{
DAMAGE_NO,
@ -77,7 +80,7 @@ typedef enum
DAMAGE_AIM
} damage_t;
// items
/* items */
typedef enum
{
IT_AXE = 4096,
@ -109,17 +112,18 @@ typedef enum
IT_QUAD = 4194304,
} items_t;
// point content values
/* point content values */
typedef enum
{
CONTENT_EMPTY,
CONTENT_SOLID,
CONTENT_WATER,
CONTENT_SLIME,
CONTENT_LAVA,
CONTENT_SKY
CONTENT_EMPTY = -1,
CONTENT_SOLID = -2,
CONTENT_WATER = -3,
CONTENT_SLIME = -4,
CONTENT_LAVA = -5,
CONTENT_SKY = -6
} content_t;
/* movable entity state */
typedef enum
{
STATE_TOP,
@ -128,13 +132,34 @@ typedef enum
STATE_DOWN
} state_t;
vector VEC_ORIGIN = '0 0 0';
vector VEC_HULL_MIN = '-16 -16 -24';
vector VEC_HULL_MAX = '16 16 32';
vector VEC_ORIGIN = [0.0, 0.0, 0.0];
vector VEC_HULL_MIN = [-16.0, -16.0, -24.0];
vector VEC_HULL_MAX = [16.0, 16.0, 32.0];
vector VEC_HULL2_MIN = '-32 -32 -24';
vector VEC_HULL2_MAX = '32 32 64';
vector VEC_HULL2_MIN = [-32.0, -32.0, -24.0];
vector VEC_HULL2_MAX = [32.0, 32.0, 64.0];
/** attenuation */
typedef enum
{
ATTN_NONE, /** heard everywhere */
ATTN_NORM, /** loud noise */
ATTN_IDLE, /** normal sound */
ATTN_STATIC, /** quiet sound */
} attn_t;
/* update types */
typedef enum
{
UPDATE_GENERAL,
UPDATE_STATIC,
UPDATE_BINARY,
UPDATE_TEMP
} update_t;
/* this is where constants can differentiate from engine to engine */
/* temporary effects */
typedef enum
{
TE_SPIKE = 0,
@ -149,11 +174,15 @@ typedef enum
TE_LIGHTNING3 = 9,
TE_LAVASPLASH = 10,
TE_TELEPORT = 11,
#ifdef TARGET_QUAKEWORLD
TE_BLOOD = 12,
TE_LIGHTNINGBLOOD = 13
#endif
} tempent_t;
// sound channels
// channel 0 never willingly overrides
// other channels (1-7) allways override a playing sound on that channel
/* sound channels
channel 0 never willingly overrides
other channels (1-7) allways override a playing sound on that channel */
typedef enum
{
CHAN_AUTO, /** next available channel */
@ -163,41 +192,59 @@ typedef enum
CHAN_BODY, /** body sound channel */
CHAN_UNUSED1,
CHAN_UNUSED2,
CHAN_UNUSED3
CHAN_UNUSED3,
#ifdef TARGET_QUAKEWORLD
CHAN_NO_PHS_ADD
#endif
} channel_t;
/** attenuation */
typedef enum
{
ATTN_NONE, /** heard everywhere */
ATTN_NORM, /** loud noise */
ATTN_IDLE, /** normal sound */
ATTN_STATIC, /** quiet sound */
} attn_t;
// update types
typedef enum
{
UPDATE_GENERAL,
UPDATE_STATIC,
UPDATE_BINARY,
UPDATE_TEMP
} update_t;
// entity effects
/* entity effects */
typedef enumflags
{
EF_BRIGHTFIELD,
EF_MUZZLEFLASH,
EF_BRIGHTFIELD, /* not available in QW */
EF_MUZZLEFLASH, /* not available in QW */
EF_BRIGHTLIGHT,
EF_DIMLIGHT
EF_DIMLIGHT,
#ifdef TARGET_QUAKEWORLD
EF_FLAG1,
EF_FLAG2,
EF_BLUE, /* blue glow */
EF_RED /* red glow */
#endif
} effects_t;
// messages
/* messages */
typedef enum
{
MSG_BROADCAST, // unreliable to all
MSG_ONE, // reliable to one (msg_entity)
MSG_ALL, // reliable to all
MSG_INIT, // write to the init string
MSG_BROADCAST, /* unreliable to all */
MSG_ONE, /* reliable to one (msg_entity) */
MSG_ALL, /* reliable to all */
MSG_INIT, /* write to the init string */
#ifdef TARGET_QUAKEWORLD
MSG_MULTICAST, /* multicast */
#endif
} msg_t;
/* special compatibility cases start here */
/* these may not be relevant in all targets */
/* respected only in QuakeWorld */
/* print types */
typedef enum
{
PRINT_LOW, /* pickup type msg */
PRINT_MEDIUM, /* obituaries */
PRINT_HIGH, /* critical */
PRINT_CHAT /* screen and console */
} print_t;
/* multicast builtin filters */
typedef enum
{
MULTICAST_ALL, /* to all */
MULTICAST_PHS, /* within earshot */
MULTICAST_PVS, /* same portal */
MULTICAST_ALL_R, /* reliable version of above */
MULTICAST_PHS_R,
MULTICAST_PVS_R
} multicast_t;

View file

@ -9,16 +9,26 @@ entity world;
float time;
/** Time in seconds since the last server frame was run. */
float frametime;
#ifdef TARGET_QUAKEWORLD
/** reused for various projectiles */
entity newmis;
#endif
/** When set, will force all entities to retouch their surroundings (.touch() will be called if they are touching anything) */
float force_retouch;
/** Contains the name of the map we're currently on. */
string mapname;
#ifndef TARGET_QUAKEWORLD
/** Mirrors the 'deathmatch' cvar. */
float deathmatch;
/** Mirrors the 'coop' cvar. */
float coop;
/** Mirros the 'teamplay' cvar */
float teamplay;
#endif
/** A persistent value that's carried across map changes within a single campaign. */
float serverflags;
/** The amount of secrets that can be triggered within this level. */
@ -100,6 +110,11 @@ void end_sys_globals;
.vector absmin;
.vector absmax;
.float ltime;
#ifdef TARGET_QUAKEWORLD
.float lastruntime;
#endif
.float movetype;
.float solid;
.vector origin;
@ -107,7 +122,11 @@ void end_sys_globals;
.vector velocity;
.vector angles;
.vector avelocity;
#ifndef TARGET_QUAKEWORLD
.vector punchangle;
#endif
.string classname;
.string model;
.float frame;
@ -143,7 +162,11 @@ void end_sys_globals;
.float impulse;
.float fixangle;
.vector v_angle;
#ifndef TARGET_QUAKEWORLD
.float idealpitch;
#endif
.string netname;
.entity enemy;
.float flags;

View file

@ -68,7 +68,6 @@ void main( void ) {
g_idEngine.Precache_Sound( "ambience/water1.wav" );
g_idEngine.Precache_Sound( "ambience/wind2.wav" );
g_idEngine.Precache_File( "maps/start.bsp" );
g_idEngine.Precache_File( "maps/scale_test.bsp" );
g_idEngine.Precache_File2( "gfx/pop.lmp" );
}

View file

@ -1,38 +1,98 @@
/* protocol specific network events */
#ifndef TARGET_QUAKEWORLD
typedef enum
{
SVC_BAD,
SVC_NOP,
SVC_DISCONNECT,
SVC_UPDATESTAT, /* byte, long */
SVC_VERSION, /* long */
SVC_SETVIEW, /* short */
SVC_SOUND, /* TODO: document */
SVC_TIME, /* float */
SVC_PRINT, /* null terminated string */
SVC_STUFFTEXT, /* newline terminated string */
SVC_SETANGLE, /* byte, byte, byte */
SVC_SERVERINFO, /* long, string, string, string */
SVC_LIGHTSTYLE, /* byte, string */
SVC_UPDATENAME, /* byte, string */
SVC_UPDATEFRAGS, /* byte, short */
SVC_CLIENTDATA, /* shortbits + data */
SVC_STOPSOUND, /* TODO: document */
SVC_UPDATECOLORS, /* byte, byte */
SVC_PARTICLE, /* vector, ... */
SVC_DAMAGE,
SVC_SPAWNSTATIC,
SVC_SPAWNBINARY, /* unused? */
SVC_TEMP_ENTITY,
SVC_SETPAUSE, /* byte */
SVC_SIGNONNUM, /* byte */
SVC_CENTERPRINT, /* string */
SVC_KILLEDMONSTER,
SVC_FOUNDSECRET,
SVC_SPAWNSTATICSOUND, /* coord 3x, byte (sample), byte (volume), byte (attenuation) */
SVC_INTERMISSION, /* string (music track) */
SVC_FINALE, /* string (music track), string (finale text) */
SVC_CDTRACK, /* byte (track), byte (loopflag) */
SVC_SELLSCREEN,
SVC_CUTSCENE
} svc_t;
SVC_BAD = 0,
SVC_NOP = 1,
SVC_DISCONNECT = 2,
SVC_UPDATESTAT = 3, /* byte, long */
SVC_VERSION = 4, /* long */
SVC_SETVIEW = 5, /* short */
SVC_SOUND = 6, /* TODO: document */
SVC_TIME = 7, /* float */
SVC_PRINT = 8, /* null terminated string */
SVC_STUFFTEXT = 9, /* newline terminated string */
SVC_SETANGLE = 10, /* byte, byte, byte */
SVC_SERVERINFO = 11, /* long, string, string, string */
SVC_LIGHTSTYLE = 12, /* byte, string */
SVC_UPDATENAME = 13, /* byte, string */
SVC_UPDATEFRAGS = 14, /* byte, short */
SVC_CLIENTDATA = 15, /* shortbits + data */
SVC_STOPSOUND = 16, /* TODO: document */
SVC_UPDATECOLORS = 17, /* byte, byte */
SVC_PARTICLE = 18, /* vector, ... */
SVC_DAMAGE = 19,
SVC_SPAWNSTATIC = 20,
SVC_SPAWNBINARY = 21, /* unused? */
SVC_TEMP_ENTITY = 22,
SVC_SETPAUSE = 23, /* byte */
SVC_SIGNONNUM = 24, /* byte */
SVC_CENTERPRINT = 25, /* string */
SVC_KILLEDMONSTER = 26,
SVC_FOUNDSECRET = 28,
SVC_SPAWNSTATICSOUND = 29, /* coord 3x, byte (sample), byte (volume), byte (attenuation) */
SVC_INTERMISSION = 30, /* string (music track) */
SVC_FINALE = 31, /* string (music track), string (finale text) */
SVC_CDTRACK = 32, /* byte (track), byte (loopflag) */
SVC_SELLSCREEN = 33,
SVC_CUTSCENE = 34
} svc_t;
#else
typedef enum
{
SVC_BAD = 0,
SVC_NOP = 1,
SVC_DISCONNECT = 2,
SVC_UPDATESTAT = 3,
SVC_VERSION = 4,
SVC_SETVIEW = 5,
SVC_SOUND = 6,
SVC_TIME = 7,
SVC_PRINT = 8,
SVC_STUFFTEXT = 9,
SVC_SETANGLE = 10,
SVC_SERVERDATA = 11,
SVC_LIGHTSTYLE = 12,
SVC_UPDATENAME = 13,
SVC_UPDATEFRAGS = 14,
SVC_CLIENTDATA = 15,
SVC_STOPSOUND = 16,
SVC_UPDATECOLORS = 17,
SVC_PARTICLE = 18,
SVC_DAMAGE = 19,
SVC_SPAWNSTATIC = 20,
SVC_SPAWNBINARY = 21,
SVC_SPAWNBASELINE = 22,
SVC_TEMP_ENTITY = 23,
SVC_SETPAUSE = 24,
SVC_SIGNONNUM = 25,
SVC_CENTERPRINT = 26,
SVC_KILLEDMONSTER = 27,
SVC_FOUNDSECRET = 28,
SVC_SPAWNSTATICSOUND = 29,
SVC_INTERMISSION = 30,
SVC_FINALE = 31,
SVC_CDTRACK = 32,
SVC_SELLSCREEN = 33,
SVC_SMALLKICK = 34,
SVC_BIGKICK = 35,
SVC_UPDATEPING = 36,
SVC_UPDATEENTERTIME = 37,
SVC_UPDATESTATLONG = 38,
SVC_MUZZLEFLASH = 39,
SVC_UPDATEUSERINFO = 40,
SVC_DOWNLOAD = 41,
SVC_PLAYERINFO = 42,
SVC_NAILS = 43,
SVC_CHOKECOUNT = 44,
SVC_MODELLIST = 45,
SVC_SOUNDLIST = 46,
SVC_PACKETENTITIES = 47,
SVC_DELTAPACKETENTITIES = 48,
SVC_MAXSPEED = 49,
SVC_ENTGRAVITY = 50,
SVC_SETINFO = 51,
SVC_SERVERINFO = 52,
SVC_UPDATEPL = 53,
} svc_t;
#endif

View file

@ -1,6 +1,8 @@
#pragma target standard
#pragma progs_dat "../progs.dat"
//#define TARGET_QUAKEWORLD 1
#includelist
defs.qh
constants.qh

View file

@ -1,82 +1,5 @@
/* these are the standard Quake engine builtins */
void makevectors(vector ang) = #1
void setorigin(entity e, vector o) = #2;
void setmodel(entity e, string m) = #3;
void setsize(entity e, vector min, vector max) = #4;
/* 5 was removed */
void break(void) = #6;
float random(void) = #7;
void sound(entity e, float chan, string samp, float vol, float atten) = #8;
vector normalize(vector v) = #9;
void error(string e) = #10;
void objerror(string e) = #11;
float vlen(vector v) = #12;
float vectoyaw(vector v) = #13;
entity spawn(void) = #14;
void remove(entity e) = #15;
void traceline(vector v1, vector v2, float nomonsters, entity forent) = #16;
entity checkclient(void) = #17;
entity find(entity start, .string fld, string match) = #18;
string precache_sound(string s) = #19;
string precache_model(string s) = #20;
void stuffcmd(entity client, string s) = #21;
entity findradius(vector org, float rad) = #22;
void bprint(string s) = #23;
void sprint(entity client, string s) = #24;
void dprint(string s) = #25;
string ftos(float f) = #26;
string vtos(vector v) = #27;
void coredump(void) = #28;
void traceon(void) = #29;
void traceoff(void) = #30;
void eprint(entity e) = #31;
float walkmove(float yaw, float dist) = #32;
// #33 was removed
float droptofloor(float yaw, float dist) = #34;
void lightstyle(float style, string value) = #35;
float rint(float v) = #36;
float floor(float v) = #37;
float ceil(float v) = #38;
// #39 was removed
float checkbottom(entity e) = #40;
float pointcontents(vector v) = #41;
// #42 was removed
float fabs(float f) = #43;
vector aim(entity e, float speed) = #44;
float cvar(string s) = #45;
void localcmd(string s) = #46;
entity nextent(entity e) = #47;
void particle(vector o, vector d, float color, float count) = #48;
void changeyaw(void) = #49;
vector vectoangles(vector v) = #51;
void writeByte(float to, float f) = #52;
void writeChar(float to, float f) = #53;
void writeShort(float to, float f) = #54;
void writeLong(float to, float f) = #55;
void writeCoord(float to, float f) = #56;
void writeAngle(float to, float f) = #57;
void writeString(float to, string s) = #58;
void writeEntity(float to, entity s) = #59;
/* 60 was removed */
/* 61 was removed */
/* 62 was removed */
/* 63 was removed */
/* 64 was removed */
/* 65 was removed */
/* 66 was removed */
void movetogoal(float step) = #67;
string precache_file(string s) = #68;
void makestatic(entity e) = #69;
void changelevel(string s) = #70;
/* 71 was removed */
void cvar_set(string var, string val) = #72;
void centerprint(entity client, string s) = #73;
void ambientsound(vector pos, string samp, float vol, float atten) = #74;
string precache_model2(string s) = #75;
string precache_sound2(string s) = #76;
string precache_file2(string s) = #77;
void setspawnparms(entity e) = #78;
/* we include this here so the rest of the codebase won't be able to call them */
#include "../builtins.qh"
void idEngine::MakeVectors( vector ang ) {
return makevectors( ang );
@ -142,7 +65,7 @@ idEntity idEngine::CheckClient( void ) {
return checkclient();
}
idEntity idEngine::Find( idEntity start,.string fld, string match ) {
idEntity idEngine::Find( idEntity start, .string fld, string match ) {
return find( start, ::fld, match );
}
@ -162,12 +85,20 @@ idEntity idEngine::FindRadius( vector org, float rad ) {
return findradius( org, rad );
}
void idEngine::BPrint( string s ) {
void idEngine::BPrint( print_t level, string s ) {
#ifdef TARGET_QUAKEWORLD
bprint( level, s );
#else
bprint( s );
#endif
}
void idEngine::SPrint( idEntity client, string s ) {
void idEngine::SPrint( idEntity client, print_t level, string s ) {
#ifdef TARGET_QUAKEWORLD
sprint( client, level, s );
#else
sprint( client, s );
#endif
}
void idEngine::DPrint( string s ) {
@ -251,11 +182,15 @@ idEntity idEngine::NextEnt( idEntity e ) {
}
void idEngine::Particle( vector o, vector d, float color, float count ) {
#ifndef TARGET_QUAKEWORLD
particle( o, d, color, count );
#endif
}
void idEngine::ChangeYaw( void ) {
#ifndef TARGET_QUAKEWORLD
changeyaw();
#endif
}
vector idEngine::VecToAngles( vector v ) {
@ -329,3 +264,31 @@ void idEngine::AmbientSound( vector pos, string samp, float vol, float atten ) {
void idEngine::SetSpawnParms( idEntity e ) {
setspawnparms( e );
}
void idEngine::LogFrag( idEntity killer, idEntity victim ) {
#ifdef TARGET_QUAKEWORLD
logfrag(killer, victim);
#endif
}
string idEngine::InfoKey( idEntity e, string key ) {
#ifdef TARGET_QUAKEWORLD
return infokey(e, key);
#else
return "";
#endif
}
float idEngine::StringToFloat( string s ) {
#ifdef TARGET_QUAKEWORLD
return stof(s);
#else
return 0.0f;
#endif
}
void idEngine::MultiCast( vector where, multicast_t set ) {
#ifdef TARGET_QUAKEWORLD
multicast(where, set);
#endif
}

View file

@ -20,8 +20,8 @@ class idEngine {
nonvirtual string Precache_Model( string s );
nonvirtual void StuffCmd( idEntity client, string s );
nonvirtual idEntity FindRadius( vector org, float rad );
nonvirtual void BPrint( string s );
nonvirtual void SPrint( idEntity client, string s );
nonvirtual void BPrint( print_t level, string s );
nonvirtual void SPrint( idEntity client, print_t level, string s );
nonvirtual void DPrint( string s );
nonvirtual string FloatToString( float f );
nonvirtual string VectorToString( vector v );
@ -62,6 +62,12 @@ class idEngine {
nonvirtual void CenterPrint( idEntity client, string s );
nonvirtual void AmbientSound( vector pos, string samp, float vol, float atten );
nonvirtual void SetSpawnParms( idEntity e );
/* natively implemented by QuakeWorld */
nonvirtual void LogFrag(idEntity killer, idEntity victim);
nonvirtual string InfoKey(idEntity e, string key);
nonvirtual float StringToFloat(string s);
nonvirtual void MultiCast(vector where, float set);
};
idEngine g_idEngine;

View file

@ -34,7 +34,9 @@ void idEntity::SetAngularVelocity( vector value ) {
}
void idEntity::SetPunchangle( vector value ) {
#ifndef TARGET_QUAKEWORLD
punchangle = value;
#endif
}
void idEntity::SetModel( string value ) {
@ -257,7 +259,11 @@ vector idEntity::GetAngularVelocity( void ) {
}
vector idEntity::GetPunchangle( void ) {
#ifndef TARGET_QUAKEWORLD
return punchangle;
#else
return [0.0, 0.0, 0.0];
#endif
}
string idEntity::GetModel( void ) {
@ -404,6 +410,10 @@ string idEntity::GetNoiseValue4( void ) {
return noise3;
}
string idEntity::GetInfoKey( string key ) {
return g_idEngine.InfoKey(this, key);
}
bool idEntity::IsPlayer( void ) {
return HasFlag(FL_CLIENT);
}

View file

@ -191,6 +191,7 @@ class idEntity {
nonvirtual string GetNoiseValue2( void );
nonvirtual string GetNoiseValue3( void );
nonvirtual string GetNoiseValue4( void );
nonvirtual string GetInfoKey( string );
nonvirtual bool IsPlayer( void );
nonvirtual bool IsMonster( void );

View file

@ -2,15 +2,15 @@ void idRules::idRules( void ) {
}
void idRules::PlayerConnects( idPlayer pl ) {
g_idEngine.BPrint( "Player connected.\n" );
g_idEngine.BPrint( PRINT_HIGH, "Player connected.\n" );
}
void idRules::PlayerDisconnects( idPlayer pl ) {
g_idEngine.BPrint( "Player disconnected.\n" );
g_idEngine.BPrint( PRINT_HIGH, "Player disconnected.\n" );
}
void idRules::PlayerFinishesJoining( idPlayer player ) {
g_idEngine.BPrint( "Player joined the game fully.\n" );
g_idEngine.BPrint( PRINT_HIGH, "Player joined the game fully.\n" );
/* reset them fully */
player.ResetPlayer();