Miscellaneous Game VM bug fixes

Bug fixes found by viewing differences from ioquake3. There is some unrelated whitespace and 0 to NULL changes.

bg_misc.c -- ioq3 and my bugfix
g_cmds.c -- ioq3 bugfix
g_combat.c -- ioq3 and my bugfix
g_main.c -- q3, ioq3, and my bugfix
g_mover.c -- ioq3 bugfix
g_svcmds.c -- q3 bugfix
g_team.c -- ioq3 bugfix
This commit is contained in:
zturtleman 2017-11-17 03:37:02 +00:00
parent d1d77c02f6
commit 0e7ddc331a
7 changed files with 230 additions and 146 deletions

View file

@ -49,7 +49,7 @@ gitem_t bg_itemlist[] =
NULL,
{ NULL,
NULL,
0, 0} ,
NULL, NULL} ,
/* icon */ NULL,
/* pickup */ NULL,
0,
@ -75,9 +75,9 @@ gitem_t bg_itemlist[] =
// { "models/powerups/armor/shard.md3",
// "models/powerups/armor/shard_sphere.md3",
{ "models/powerups/armor/greenshard.md3",
0,
NULL,
// END
0, 0} ,
NULL, NULL} ,
// STONELANCE
// "icons/iconr_shard", // icon
// "Armor Shard", // pickup
@ -104,7 +104,7 @@ gitem_t bg_itemlist[] =
// { "models/powerups/armor/armor_yel.md3",
{ "models/powerups/armor/yellowshard.md3",
// END
0, 0, 0},
NULL, NULL, NULL},
// STONELANCE
// "icons/iconr_yellow", // icon
// "Armor", // pickup
@ -130,7 +130,7 @@ gitem_t bg_itemlist[] =
// { "models/powerups/armor/armor_red.md3",
{ "models/powerups/armor/redshard.md3",
// END
0, 0, 0},
NULL, NULL, NULL},
// STONELANCE
// "icons/iconr_red", // icon
// "Heavy Armor", // pickup
@ -154,7 +154,7 @@ gitem_t bg_itemlist[] =
"sound/items/s_health.wav",
{ "models/powerups/health/small_cross.md3",
"models/powerups/health/small_sphere.md3",
0, 0 },
NULL, NULL },
/* icon */ "icons/iconh_green",
/* pickup */ "5 Health",
5,
@ -171,7 +171,7 @@ gitem_t bg_itemlist[] =
"sound/items/n_health.wav",
{ "models/powerups/health/medium_cross.md3",
"models/powerups/health/medium_sphere.md3",
0, 0 },
NULL, NULL },
/* icon */ "icons/iconh_yellow",
/* pickup */ "25 Health",
25,
@ -188,7 +188,7 @@ gitem_t bg_itemlist[] =
"sound/items/l_health.wav",
{ "models/powerups/health/large_cross.md3",
"models/powerups/health/large_sphere.md3",
0, 0 },
NULL, NULL },
/* icon */ "icons/iconh_red",
/* pickup */ "50 Health",
50,
@ -205,7 +205,7 @@ gitem_t bg_itemlist[] =
"sound/items/m_health.wav",
{ "models/powerups/health/mega_cross.md3",
"models/powerups/health/mega_sphere.md3",
0, 0 },
NULL, NULL },
/* icon */ "icons/iconh_mega",
/* pickup */ "Mega Health",
100,
@ -226,7 +226,7 @@ gitem_t bg_itemlist[] =
"weapon_gauntlet",
"sound/misc/w_pkup.wav",
{ "models/weapons2/gauntlet/gauntlet.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_gauntlet",
/* pickup */ "Gauntlet",
0,
@ -242,7 +242,7 @@ gitem_t bg_itemlist[] =
"weapon_shotgun",
"sound/misc/w_pkup.wav",
{ "models/weapons2/shotgun/shotgun.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_shotgun",
/* pickup */ "Shotgun",
10,
@ -258,7 +258,7 @@ gitem_t bg_itemlist[] =
"weapon_machinegun",
"sound/misc/w_pkup.wav",
{ "models/weapons2/machinegun/machinegun.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_machinegun",
/* pickup */ "Machinegun",
40,
@ -274,7 +274,7 @@ gitem_t bg_itemlist[] =
"weapon_grenadelauncher",
"sound/misc/w_pkup.wav",
{ "models/weapons2/grenadel/grenadel.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_grenade",
/* pickup */ "Grenade Launcher",
10,
@ -290,7 +290,7 @@ gitem_t bg_itemlist[] =
"weapon_rocketlauncher",
"sound/misc/w_pkup.wav",
{ "models/weapons2/rocketl/rocketl.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_rocket",
/* pickup */ "Rocket Launcher",
10,
@ -306,7 +306,7 @@ gitem_t bg_itemlist[] =
"weapon_lightning",
"sound/misc/w_pkup.wav",
{ "models/weapons2/lightning/lightning.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_lightning",
/* pickup */ "Lightning Gun",
100,
@ -322,7 +322,7 @@ gitem_t bg_itemlist[] =
"weapon_railgun",
"sound/misc/w_pkup.wav",
{ "models/weapons2/railgun/railgun.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_railgun",
/* pickup */ "Railgun",
10,
@ -338,7 +338,7 @@ gitem_t bg_itemlist[] =
"weapon_plasmagun",
"sound/misc/w_pkup.wav",
{ "models/weapons2/plasma/plasma.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_plasma",
/* pickup */ "Plasma Gun",
50,
@ -354,7 +354,7 @@ gitem_t bg_itemlist[] =
"weapon_bfg",
"sound/misc/w_pkup.wav",
{ "models/weapons2/bfg/bfg.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_bfg",
/* pickup */ "BFG10K",
20,
@ -364,7 +364,6 @@ gitem_t bg_itemlist[] =
/* sounds */ ""
},
/*QUAKED weapon_grapplinghook (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
*/
// STONELANCE
@ -373,7 +372,7 @@ gitem_t bg_itemlist[] =
"weapon_grapplinghook",
"sound/misc/w_pkup.wav",
{ "models/weapons2/grapple/grapple.md3",
0, 0, 0},
NULL, NULL, NULL},
"icons/iconw_grapple", // icon
"Grappling Hook", // pickup
0,
@ -393,7 +392,7 @@ gitem_t bg_itemlist[] =
"weapon_flamethrower",
"sound/misc/w_pkup.wav",
{ "models/weapons2/flamethrower/flamethrower.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_flame",
/* pickup */ "Flame Thrower",
20,
@ -411,7 +410,7 @@ gitem_t bg_itemlist[] =
"rally_weapon_smoke",
"sound/misc/w_pkup.wav",
{ "models/rearfire/rf_smoke.md3",
0, 0, 0},
NULL, NULL, NULL},
"icons/rf_smoke", // icon
"Rearfire Smoke Screen", // pickup
15,
@ -426,7 +425,7 @@ gitem_t bg_itemlist[] =
"rally_weapon_oil",
"sound/misc/w_pkup.wav",
{ "models/rearfire/rf_oil.md3",
0, 0, 0},
NULL, NULL, NULL},
"icons/rf_oil", // icon
"Rearfire Oil Slick", // pickup
15,
@ -441,7 +440,7 @@ gitem_t bg_itemlist[] =
"rally_weapon_mine",
"sound/misc/w_pkup.wav",
{ "models/rearfire/rf_mines.md3",
0, 0, 0},
NULL, NULL, NULL},
"icons/rf_mine", // icon
"Rearfire Mine", // pickup
5,
@ -456,7 +455,7 @@ gitem_t bg_itemlist[] =
"rally_weapon_flame",
"sound/misc/w_pkup.wav",
{ "models/rearfire/rf_flame.md3",
0, 0, 0},
NULL, NULL, NULL},
"icons/rf_flame", // icon
"Rearfire Flame Trail", // pickup
15,
@ -471,7 +470,7 @@ gitem_t bg_itemlist[] =
"rally_weapon_bio",
"sound/misc/w_pkup.wav",
{ "models/rearfire/rf_bio.md3",
0, 0, 0},
NULL, NULL, NULL},
"icons/rf_bio", // icon
"Rearfire Bio Sludge", // pickup
15,
@ -492,7 +491,7 @@ gitem_t bg_itemlist[] =
"ammo_shells",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/shotgunam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_shotgun",
/* pickup */ "Shells",
10,
@ -508,7 +507,7 @@ gitem_t bg_itemlist[] =
"ammo_bullets",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/machinegunam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_machinegun",
/* pickup */ "Bullets",
50,
@ -524,7 +523,7 @@ gitem_t bg_itemlist[] =
"ammo_grenades",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/grenadeam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_grenade",
/* pickup */ "Grenades",
5,
@ -540,7 +539,7 @@ gitem_t bg_itemlist[] =
"ammo_cells",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/plasmaam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_plasma",
/* pickup */ "Cells",
30,
@ -556,7 +555,7 @@ gitem_t bg_itemlist[] =
"ammo_lightning",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/lightningam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_lightning",
/* pickup */ "Lightning",
60,
@ -572,7 +571,7 @@ gitem_t bg_itemlist[] =
"ammo_rockets",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/rocketam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_rocket",
/* pickup */ "Rockets",
5,
@ -588,7 +587,7 @@ gitem_t bg_itemlist[] =
"ammo_slugs",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/railgunam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_railgun",
/* pickup */ "Slugs",
10,
@ -604,7 +603,7 @@ gitem_t bg_itemlist[] =
"ammo_bfg",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/bfgam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_bfg",
/* pickup */ "Bfg Ammo",
15,
@ -622,7 +621,7 @@ gitem_t bg_itemlist[] =
"ammo_flame",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/bfgam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_flame",
/* pickup */ "Flame Ammo",
50,
@ -643,7 +642,7 @@ gitem_t bg_itemlist[] =
"holdable_teleporter",
"sound/items/holdable.wav",
{ "models/powerups/holdable/teleporter.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/teleporter",
/* pickup */ "Personal Teleporter",
60,
@ -660,7 +659,7 @@ gitem_t bg_itemlist[] =
{
"models/powerups/holdable/medkit.md3",
"models/powerups/holdable/medkit_sphere.md3",
0, 0},
NULL, NULL},
/* icon */ "icons/medkit",
/* pickup */ "Medkit",
60,
@ -677,7 +676,7 @@ gitem_t bg_itemlist[] =
"sound/items/turbo.wav",
{ "models/powerups/turbo/turbo.md3",
"models/powerups/turbo/turbogear.md3",
0, 0 },
NULL, NULL},
"icons/turbo", // icons
"Turbo", // pickup
5,
@ -705,7 +704,7 @@ gitem_t bg_itemlist[] =
{ "models/powerups/quad/quad.md3",
"models/powerups/quad/quadring.md3",
// END
0, 0 },
NULL, NULL },
/* icon */ "icons/quad",
/* pickup */ "Quad Damage",
30,
@ -729,7 +728,7 @@ gitem_t bg_itemlist[] =
{ "models/powerups/env/atomic.md3",
"models/powerups/env/envgear.md3",
// END
0, 0 },
NULL, NULL },
// STONELANCE
// "icons/envirosuit", // icons
// "Battle Suit", // pickup
@ -754,11 +753,11 @@ gitem_t bg_itemlist[] =
// STONELANCE
// { "models/powerups/instant/haste.md3",
// "models/powerups/instant/haste_ring.md3",
// 0, 0 },
// NULL, NULL },
{ "models/powerups/haste/haste.md3",
"models/powerups/haste/hagear.md3",
"models/powerups/haste/hasteshell.md3",
0 },
NULL },
// END
/* icon */ "icons/haste",
// STONELANCE
@ -786,7 +785,7 @@ gitem_t bg_itemlist[] =
{ "models/powerups/invis/invis.md3",
"models/powerups/invis/invisgear.md3",
// END
0, 0 },
NULL, NULL },
/* icon */ "icons/invis",
/* pickup */ "Invisibility",
30,
@ -810,7 +809,7 @@ gitem_t bg_itemlist[] =
{ "models/powerups/regen/regen.md3",
"models/powerups/regen/regear.md3",
// END
0, 0 },
NULL, NULL },
/* icon */ "icons/regen",
/* pickup */ "Regeneration",
30,
@ -827,7 +826,7 @@ gitem_t bg_itemlist[] =
"sound/items/flight.wav",
{ "models/powerups/instant/flight.md3",
"models/powerups/instant/flight_ring.md3",
0, 0 },
NULL, NULL },
"icons/flight", // icons
"Flight", // pickup
60,
@ -845,7 +844,7 @@ gitem_t bg_itemlist[] =
"sound/items/shield.wav",
{ "models/powerups/shield/shield.md3",
"models/powerups/shield/shgear.md3",
0, 0 },
NULL, NULL },
"icons/shield", // icons
"Shielding", // pickup
30,
@ -863,7 +862,7 @@ Only in CTF games
"team_CTF_redflag",
NULL,
{ "models/flags/r_flag.md3",
0, 0, 0 },
NULL, NULL, NULL },
/* icon */ "icons/iconf_red1",
/* pickup */ "Red Flag",
0,
@ -880,7 +879,7 @@ Only in CTF games
"team_CTF_blueflag",
NULL,
{ "models/flags/b_flag.md3",
0, 0, 0 },
NULL, NULL, NULL },
/* icon */ "icons/iconf_blu1",
/* pickup */ "Blue Flag",
0,
@ -890,7 +889,6 @@ Only in CTF games
/* sounds */ ""
},
#ifdef MISSIONPACK
/*QUAKED holdable_kamikaze (.3 .3 1) (-16 -16 -16) (16 16 16) suspended
*/
@ -898,7 +896,7 @@ Only in CTF games
"holdable_kamikaze",
"sound/items/holdable.wav",
{ "models/powerups/kamikazi.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/kamikaze",
/* pickup */ "Kamikaze",
60,
@ -914,7 +912,7 @@ Only in CTF games
"holdable_portal",
"sound/items/holdable.wav",
{ "models/powerups/holdable/porter.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/portal",
/* pickup */ "Portal",
60,
@ -930,7 +928,7 @@ Only in CTF games
"holdable_invulnerability",
"sound/items/holdable.wav",
{ "models/powerups/holdable/invulnerability.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/invulnerability",
/* pickup */ "Invulnerability",
60,
@ -946,7 +944,7 @@ Only in CTF games
"ammo_nails",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/nailgunam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_nailgun",
/* pickup */ "Nails",
20,
@ -962,7 +960,7 @@ Only in CTF games
"ammo_mines",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/proxmineam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_proxlauncher",
/* pickup */ "Proximity Mines",
10,
@ -978,7 +976,7 @@ Only in CTF games
"ammo_belt",
"sound/misc/am_pkup.wav",
{ "models/powerups/ammo/chaingunam.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/icona_chaingun",
/* pickup */ "Chaingun Belt",
100,
@ -997,7 +995,7 @@ Only in CTF games
"item_scout",
"sound/items/scout.wav",
{ "models/powerups/scout.md3",
0, 0, 0 },
NULL, NULL, NULL },
/* icon */ "icons/scout",
/* pickup */ "Scout",
30,
@ -1013,7 +1011,7 @@ Only in CTF games
"item_guard",
"sound/items/guard.wav",
{ "models/powerups/guard.md3",
0, 0, 0 },
NULL, NULL, NULL },
/* icon */ "icons/guard",
/* pickup */ "Guard",
30,
@ -1029,7 +1027,7 @@ Only in CTF games
"item_doubler",
"sound/items/doubler.wav",
{ "models/powerups/doubler.md3",
0, 0, 0 },
NULL, NULL, NULL },
/* icon */ "icons/doubler",
/* pickup */ "Doubler",
30,
@ -1045,7 +1043,7 @@ Only in CTF games
"item_ammoregen",
"sound/items/ammoregen.wav",
{ "models/powerups/ammo.md3",
0, 0, 0 },
NULL, NULL, NULL },
/* icon */ "icons/ammo_regen",
/* pickup */ "Ammo Regen",
30,
@ -1062,7 +1060,7 @@ Only in One Flag CTF games
"team_CTF_neutralflag",
NULL,
{ "models/flags/n_flag.md3",
0, 0, 0 },
NULL, NULL, NULL },
/* icon */ "icons/iconf_neutral1",
/* pickup */ "Neutral Flag",
0,
@ -1076,7 +1074,7 @@ Only in One Flag CTF games
"item_redcube",
"sound/misc/am_pkup.wav",
{ "models/powerups/orb/r_orb.md3",
0, 0, 0 },
NULL, NULL, NULL },
/* icon */ "icons/iconh_rorb",
/* pickup */ "Red Cube",
0,
@ -1090,7 +1088,7 @@ Only in One Flag CTF games
"item_bluecube",
"sound/misc/am_pkup.wav",
{ "models/powerups/orb/b_orb.md3",
0, 0, 0 },
NULL, NULL, NULL },
/* icon */ "icons/iconh_borb",
/* pickup */ "Blue Cube",
0,
@ -1105,7 +1103,7 @@ Only in One Flag CTF games
"weapon_nailgun",
"sound/misc/w_pkup.wav",
{ "models/weapons/nailgun/nailgun.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_nailgun",
/* pickup */ "Nailgun",
10,
@ -1121,7 +1119,7 @@ Only in One Flag CTF games
"weapon_prox_launcher",
"sound/misc/w_pkup.wav",
{ "models/weapons/proxmine/proxmine.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_proxlauncher",
/* pickup */ "Prox Launcher",
5,
@ -1142,7 +1140,7 @@ Only in One Flag CTF games
"weapon_chaingun",
"sound/misc/w_pkup.wav",
{ "models/weapons/vulcan/vulcan.md3",
0, 0, 0},
NULL, NULL, NULL},
/* icon */ "icons/iconw_chaingun",
/* pickup */ "Chaingun",
80,
@ -1431,6 +1429,7 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const play
return qtrue;
}
}
#ifdef MISSIONPACK
if( gametype == GT_HARVESTER ) {
return qtrue;
@ -1438,7 +1437,6 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const play
#endif
return qfalse;
case IT_HOLDABLE:
// can only hold one item at a time
if ( ps->stats[STAT_HOLDABLE_ITEM] ) {
@ -1448,10 +1446,9 @@ qboolean BG_CanItemBeGrabbed( int gametype, const entityState_t *ent, const play
case IT_BAD:
Com_Error( ERR_DROP, "BG_CanItemBeGrabbed: IT_BAD" );
break;
default:
#ifndef Q3_VM
#ifndef NDEBUG // bk0001204
#ifndef NDEBUG
Com_Printf("BG_CanItemBeGrabbed: unknown enum %d\n", item->giType );
#endif
#endif
@ -1593,9 +1590,9 @@ char *eventnames[] = {
"EV_NOAMMO",
"EV_CHANGE_WEAPON",
"EV_FIRE_WEAPON",
"EV_ALTFIRE_WEAPON",
// STONELANCE
"EV_HAZARD",
"EV_ALTFIRE_WEAPON",
"EV_FIRE_REARWEAPON",
// END
@ -1647,10 +1644,16 @@ char *eventnames[] = {
"EV_POWERUP_BATTLESUIT",
// STONELANCE
"EV_POWERUP_SHIELD",
"EV_POWERUP_TURBO",
// END
"EV_POWERUP_REGEN",
"EV_GIB_PLAYER", // gib a previously living player
//Q3Rally Code Start
"EV_BREAK_GLASS",
"EV_BREAKWOOD",
"EV_BREAKMETAL",
//Q3Rally Code End
"EV_SCOREPLUM", // score plum
//#ifdef MISSIONPACK
@ -1658,6 +1661,7 @@ char *eventnames[] = {
"EV_PROXIMITY_MINE_TRIGGER",
"EV_KAMIKAZE", // kamikaze explodes
"EV_OBELISKEXPLODE", // obelisk explodes
"EV_OBELISKPAIN", // obelisk pain
"EV_INVUL_IMPACT", // invulnerability sphere impact
"EV_JUICED", // invulnerability juiced effect
"EV_LIGHTNINGBOLT", // lightning bolt bounced of invulnerability sphere
@ -1666,15 +1670,30 @@ char *eventnames[] = {
"EV_DEBUG_LINE",
"EV_STOPLOOPINGSOUND",
"EV_TAUNT",
// STONELANCE
"EV_TAUNT_YES",
"EV_TAUNT_NO",
"EV_TAUNT_FOLLOWME",
"EV_TAUNT_GETFLAG",
"EV_TAUNT_GUARDBASE",
"EV_TAUNT_PATROL"
// END
"EV_TAUNT_PATROL",
//Q3Rally Code Start
"EV_EMIT_DEBRIS_LIGHT",
"EV_EMIT_DEBRIS_DARK",
"EV_EMIT_DEBRIS_LIGHT_LARGE",
"EV_EMIT_DEBRIS_DARK_LARGE",
"EV_EMIT_DEBRIS_WOOD",
"EV_EMIT_DEBRIS_FLESH",
"EV_EMIT_DEBRIS_GLASS",
"EV_EMIT_DEBRIS_STONE",
"EV_EARTHQUAKE",
"EV_EXPLOSION",
"EV_PARTICLES_GRAVITY",
"EV_PARTICLES_LINEAR",
"EV_PARTICLES_LINEAR_UP",
"EV_PARTICLES_LINEAR_DOWN"
//Q3Rally Code End
};
/*
@ -1780,7 +1799,7 @@ void BG_PlayerStateToEntityState( playerState_t *ps, entityState_t *s, qboolean
// STONELANCE
// if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR ) {
if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR ||
ps->pm_flags & PMF_OBSERVE ) {
( ps->pm_flags & PMF_OBSERVE ) ) {
// END
s->eType = ET_INVISIBLE;
} else if ( ps->stats[STAT_HEALTH] <= GIB_HEALTH ) {
@ -1896,7 +1915,7 @@ void BG_PlayerStateToEntityStateExtraPolate( playerState_t *ps, entityState_t *s
// STONELANCE
// if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR ) {
if ( ps->pm_type == PM_INTERMISSION || ps->pm_type == PM_SPECTATOR ||
ps->pm_flags & PMF_OBSERVE || isRaceObserver( ps->clientNum ) ) {
( ps->pm_flags & PMF_OBSERVE ) || isRaceObserver( ps->clientNum ) ) {
// END
s->eType = ET_INVISIBLE;
} else if ( ps->stats[STAT_HEALTH] <= GIB_HEALTH ) {

View file

@ -675,21 +675,21 @@ void SetTeam( gentity_t *ent, const char *s ) {
if ( g_teamForceBalance.integer && !client->pers.localClient && !( ent->r.svFlags & SVF_BOT ) ) {
int counts[TEAM_NUM_TEAMS];
counts[TEAM_BLUE] = TeamCount( ent->client->ps.clientNum, TEAM_BLUE );
counts[TEAM_RED] = TeamCount( ent->client->ps.clientNum, TEAM_RED );
counts[TEAM_BLUE] = TeamCount( clientNum, TEAM_BLUE );
counts[TEAM_RED] = TeamCount( clientNum, TEAM_RED );
// STONELANCE
counts[TEAM_GREEN] = TeamCount( ent->client->ps.clientNum, TEAM_GREEN );
counts[TEAM_YELLOW] = TeamCount( ent->client->ps.clientNum, TEAM_YELLOW );
counts[TEAM_GREEN] = TeamCount( clientNum, TEAM_GREEN );
counts[TEAM_YELLOW] = TeamCount( clientNum, TEAM_YELLOW );
// We allow a spread of two
/*
if ( team == TEAM_RED && counts[TEAM_RED] - counts[TEAM_BLUE] > 1 ) {
trap_SendServerCommand( ent->client->ps.clientNum,
trap_SendServerCommand( clientNum,
"cp \"Red team has too many players.\n\"" );
return; // ignore the request
}
if ( team == TEAM_BLUE && counts[TEAM_BLUE] - counts[TEAM_RED] > 1 ) {
trap_SendServerCommand( ent->client->ps.clientNum,
trap_SendServerCommand( clientNum,
"cp \"Blue team has too many players.\n\"" );
return; // ignore the request
}
@ -697,14 +697,14 @@ void SetTeam( gentity_t *ent, const char *s ) {
if ( team == TEAM_RED && counts[TEAM_RED] - counts[TEAM_BLUE] > 1
&& counts[TEAM_RED] - counts[TEAM_GREEN] > 1
&& counts[TEAM_RED] - counts[TEAM_YELLOW] > 1) {
trap_SendServerCommand( ent->client->ps.clientNum,
trap_SendServerCommand( clientNum,
"cp \"Red team has too many players.\n\"" );
return; // ignore the request
}
if ( team == TEAM_BLUE && counts[TEAM_BLUE] - counts[TEAM_RED] > 1
&& counts[TEAM_BLUE] - counts[TEAM_GREEN] > 1
&& counts[TEAM_YELLOW] - counts[TEAM_YELLOW] > 1) {
trap_SendServerCommand( ent->client->ps.clientNum,
trap_SendServerCommand( clientNum,
"cp \"Blue team has too many players.\n\"" );
return; // ignore the request
}
@ -712,14 +712,14 @@ void SetTeam( gentity_t *ent, const char *s ) {
if ( team == TEAM_GREEN && counts[TEAM_GREEN] - counts[TEAM_RED] > 1
&& counts[TEAM_GREEN] - counts[TEAM_BLUE] > 1
&& counts[TEAM_GREEN] - counts[TEAM_YELLOW] > 1) {
trap_SendServerCommand( ent->client->ps.clientNum,
trap_SendServerCommand( clientNum,
"cp \"Green team has too many players.\n\"" );
return; // ignore the request
}
if ( team == TEAM_YELLOW && counts[TEAM_YELLOW] - counts[TEAM_RED] > 1
&& counts[TEAM_YELLOW] - counts[TEAM_BLUE] > 1
&& counts[TEAM_YELLOW] - counts[TEAM_GREEN] > 1) {
trap_SendServerCommand( ent->client->ps.clientNum,
trap_SendServerCommand( clientNum,
"cp \"Yellow team has too many players.\n\"" );
return; // ignore the request
}
@ -1516,6 +1516,7 @@ Cmd_CallVote_f
==================
*/
void Cmd_CallVote_f( gentity_t *ent ) {
char* c;
int i;
char arg1[MAX_STRING_TOKENS];
char arg2[MAX_STRING_TOKENS];
@ -1546,9 +1547,16 @@ void Cmd_CallVote_f( gentity_t *ent ) {
trap_Argv( 1, arg1, sizeof( arg1 ) );
trap_Argv( 2, arg2, sizeof( arg2 ) );
if( strchr( arg1, ';' ) || strchr( arg2, ';' ) ) {
// check for command separators in arg2
for( c = arg2; *c; ++c) {
switch(*c) {
case '\n':
case '\r':
case ';':
trap_SendServerCommand( ent-g_entities, "print \"Invalid vote string.\n\"" );
return;
break;
}
}
// STONELANCE
@ -1913,6 +1921,7 @@ void Cmd_SetViewpos_f( gentity_t *ent ) {
}
/*
=================
Cmd_Stats_f
@ -2208,8 +2217,6 @@ void ClientCommand( int clientNum ) {
Cmd_MoveBHandle_f (ent);
return;
}
// END
else
trap_SendServerCommand( clientNum, va("print \"unknown cmd %s\n\"", cmd ) );

View file

@ -331,6 +331,9 @@ char *modNames[] = {
"MOD_ROCKET_SPLASH",
"MOD_PLASMA",
"MOD_PLASMA_SPLASH",
// Q3Rally Code Start
"MOD_FLAME_THROWER",
// // Q3Rally Code End
"MOD_RAILGUN",
"MOD_LIGHTNING",
"MOD_BFG",
@ -348,6 +351,8 @@ char *modNames[] = {
"MOD_NAIL",
"MOD_CHAINGUN",
"MOD_PROXIMITY_MINE",
"MOD_KAMIKAZE",
"MOD_JUICED",
#endif
// Q3Rally Code Start
"MOD_UPSIDEDOWN",
@ -750,6 +755,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
}
trap_LinkEntity (self);
}
@ -926,7 +932,6 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
attacker = &g_entities[ENTITYNUM_WORLD];
}
// shootable doors / buttons don't actually have any health
if ( targ->s.eType == ET_MOVER ) {
if ( targ->use && (targ->moverState == MOVER_POS1
@ -1083,7 +1088,8 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
// END
// add to the attacker's hit counter (if the target isn't a general entity like a prox mine)
if ( attacker->client && targ != attacker && targ->health > 0
if ( attacker->client && client
&& targ != attacker && targ->health > 0
&& targ->s.eType != ET_MISSILE
&& targ->s.eType != ET_GENERAL) {
if ( OnSameTeam( targ, attacker ) ) {

View file

@ -70,8 +70,8 @@ vmCvar_t g_synchronousClients;
vmCvar_t g_warmup;
vmCvar_t g_doWarmup;
vmCvar_t g_restarted;
vmCvar_t g_log;
vmCvar_t g_logSync;
vmCvar_t g_logfile;
vmCvar_t g_logfileSync;
vmCvar_t g_blood;
vmCvar_t g_podiumDist;
vmCvar_t g_podiumDrop;
@ -165,8 +165,8 @@ static cvarTable_t gameCvarTable[] = {
{ &g_warmup, "g_warmup", "20", CVAR_ARCHIVE, 0, qtrue },
{ &g_doWarmup, "g_doWarmup", "0", CVAR_ARCHIVE, 0, qtrue },
{ &g_log, "g_log", "games.log", CVAR_ARCHIVE, 0, qfalse },
{ &g_logSync, "g_logSync", "0", CVAR_ARCHIVE, 0, qfalse },
{ &g_logfile, "g_log", "games.log", CVAR_ARCHIVE, 0, qfalse },
{ &g_logfileSync, "g_logsync", "0", CVAR_ARCHIVE, 0, qfalse },
{ &g_password, "g_password", "", CVAR_USERINFO, 0, qfalse },
@ -543,14 +543,14 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
level.snd_fry = G_SoundIndex("sound/player/fry.wav"); // FIXME standing in lava / slime
if ( g_gametype.integer != GT_SINGLE_PLAYER && g_log.string[0] ) {
if ( g_logSync.integer ) {
trap_FS_FOpenFile( g_log.string, &level.logFile, FS_APPEND_SYNC );
if ( g_gametype.integer != GT_SINGLE_PLAYER && g_logfile.string[0] ) {
if ( g_logfileSync.integer ) {
trap_FS_FOpenFile( g_logfile.string, &level.logFile, FS_APPEND_SYNC );
} else {
trap_FS_FOpenFile( g_log.string, &level.logFile, FS_APPEND );
trap_FS_FOpenFile( g_logfile.string, &level.logFile, FS_APPEND );
}
if ( !level.logFile ) {
G_Printf( "WARNING: Couldn't open logfile: %s\n", g_log.string );
G_Printf( "WARNING: Couldn't open logfile: %s\n", g_logfile.string );
} else {
char serverinfo[MAX_INFO_STRING];
@ -624,6 +624,8 @@ void G_InitGame( int levelTime, int randomSeed, int restart ) {
G_RemapTeamShaders();
trap_SetConfigstring( CS_INTERMISSION, "" );
// STONELANCE
/*
{
@ -675,9 +677,6 @@ void G_ShutdownGame( int restart ) {
//===================================================================
#ifndef GAME_HARD_LINKED
// this is only here so the functions in q_shared.c and bg_*.c can link
void QDECL Com_Error ( int level, const char *error, ... ) {
va_list argptr;
char text[1024];
@ -700,8 +699,6 @@ void QDECL Com_Printf( const char *msg, ... ) {
trap_Print( text );
}
#endif
/*
========================================================================
@ -855,7 +852,6 @@ void AdjustTournamentScores( void ) {
ClientUserinfoChanged( clientNum );
}
trap_SetConfigstring( CS_INTERMISSION, "" );
}
/*
@ -981,7 +977,6 @@ void CalculateRanks( void ) {
int rank;
int score;
int newScore;
int humanplayers;
gclient_t *cl;
level.follow1 = -1;
@ -989,7 +984,7 @@ void CalculateRanks( void ) {
level.numConnectedClients = 0;
level.numNonSpectatorClients = 0;
level.numPlayingClients = 0;
humanplayers = 0; //level.numVotingClients = 0; // don't count bots
level.numVotingClients = 0; // don't count bots
for (i = 0; i < ARRAY_LEN(level.numteamVotingClients); i++)
level.numteamVotingClients[i] = 0;
@ -1090,9 +1085,9 @@ void CalculateRanks( void ) {
SendScoreboardMessageToAllClients();
}
if(g_humanplayers.integer != humanplayers) //Presume all spectators are humans!
trap_Cvar_Set( "g_humanplayers", va("%i", humanplayers) );
if ( g_humanplayers.integer != level.numVotingClients ) {
trap_Cvar_Set( "g_humanplayers", va( "%i", level.numVotingClients ) );
}
}
@ -1490,7 +1485,7 @@ wait 10 seconds before going on.
=================
*/
void CheckIntermissionExit( void ) {
int ready, notReady;
int ready, notReady, playerCount;
int i;
gclient_t *cl;
int readyMask;
@ -1503,6 +1498,7 @@ void CheckIntermissionExit( void ) {
ready = 0;
notReady = 0;
readyMask = 0;
playerCount = 0;
for (i=0 ; i< g_maxclients.integer ; i++) {
cl = level.clients + i;
if ( cl->pers.connected != CON_CONNECTED ) {
@ -1512,6 +1508,7 @@ void CheckIntermissionExit( void ) {
continue;
}
playerCount++;
if ( cl->readyToExit ) {
ready++;
if ( i < 16 ) {
@ -1537,6 +1534,8 @@ void CheckIntermissionExit( void ) {
return;
}
// only test ready status when there are real players present
if ( playerCount > 0 ) {
// if nobody wants to go, clear timer
if ( !ready ) {
level.readyToExit = qfalse;
@ -1548,6 +1547,7 @@ void CheckIntermissionExit( void ) {
ExitLevel();
return;
}
}
// the first person to ready starts the ten second timeout
if ( !level.readyToExit ) {
@ -1860,7 +1860,12 @@ void CheckTournament( void ) {
if ( level.warmupTime < 0 ) {
if ( level.numPlayingClients == 2 ) {
// fudge by -1 to account for extra delays
if ( g_warmup.integer > 1 ) {
level.warmupTime = level.time + ( g_warmup.integer - 1 ) * 1000;
} else {
level.warmupTime = 0;
}
trap_SetConfigstring( CS_WARMUP, va("%i", level.warmupTime) );
}
return;
@ -1952,6 +1957,7 @@ void CheckVote( void ) {
if ( level.time - level.voteTime >= VOTE_TIME ) {
trap_SendServerCommand( -1, "print \"Vote failed.\n\"" );
} else {
// ATVI Q3 1.32 Patch #9, WNF
if ( level.voteYes > level.numVotingClients/2 ) {
// execute the command, then remove the vote
trap_SendServerCommand( -1, "print \"Vote passed.\n\"" );
@ -2270,4 +2276,3 @@ void G_RunFrame( int levelTime ) {
trap_Cvar_Set("g_listEntity", "0");
}
}

View file

@ -70,7 +70,6 @@ gentity_t *G_TestEntityPosition( gentity_t *ent ) {
return NULL;
}
/*
================
G_CreateRotationMatrix
@ -109,7 +108,6 @@ void G_RotatePoint(vec3_t point, vec3_t matrix[3]) {
point[2] = DotProduct(matrix[2], tvec);
}
/*
==================
G_TryPushingEntity
@ -194,7 +192,6 @@ qboolean G_TryPushingEntity( gentity_t *check, gentity_t *pusher, vec3_t move, v
check->client->ps.delta_angles[YAW] += ANGLE2SHORT(amove[YAW]);
}
// may have pushed them off an edge
if ( check->s.groundEntityNum != pusher->s.number ) {
check->s.groundEntityNum = ENTITYNUM_NONE;
@ -1679,6 +1676,25 @@ void Reached_Train( gentity_t *ent ) {
ent->s.pos.trDuration = length * 1000 / speed;
// Tequila comment: Be sure to send to clients after any fast move case
ent->r.svFlags &= ~SVF_NOCLIENT;
// Tequila comment: Fast move case
if(ent->s.pos.trDuration<1) {
// Tequila comment: As trDuration is used later in a division, we need to avoid that case now
// With null trDuration,
// the calculated rocks bounding box becomes infinite and the engine think for a short time
// any entity is riding that mover but not the world entity... In rare case, I found it
// can also stuck every map entities after func_door are used.
// The desired effect with very very big speed is to have instant move, so any not null duration
// lower than a frame duration should be sufficient.
// Afaik, the negative case don't have to be supported.
ent->s.pos.trDuration=1;
// Tequila comment: Don't send entity to clients so it becomes really invisible
ent->r.svFlags |= SVF_NOCLIENT;
}
// looping sound
ent->s.loopSound = next->soundLoop;

View file

@ -38,7 +38,8 @@ You can add or remove addresses from the filter list with:
addip <ip>
removeip <ip>
The ip address is specified in dot format, and any unspecified digits will match any value, so you can specify an entire class C network with "addip 192.246.40".
The ip address is specified in dot format, and you can use '*' to match any value
so you can specify an entire class C network with "addip 192.246.40.*"
Removeip will only remove an address specified exactly the same way. You cannot addip a subnet, then removeip a single host.
@ -51,14 +52,14 @@ If 1 (the default), then ip addresses matching the current list will be prohibit
If 0, then only addresses matching the list will be allowed. This lets you easily set up a private game, or a game that only allows players from your local network.
TTimo NOTE: for persistence, bans are stored in g_banIPs cvar MAX_CVAR_VALUE_STRING
The size of the cvar string buffer is limiting the banning to around 20 masks
this could be improved by putting some g_banIPs2 g_banIps3 etc. maybe
still, you should rely on PB for banning instead
==============================================================================
*/
// extern vmCvar_t g_banIPs;
// extern vmCvar_t g_filterBan;
typedef struct ipFilter_s
{
unsigned mask;
@ -92,6 +93,15 @@ static qboolean StringToFilter (char *s, ipFilter_t *f)
{
if (*s < '0' || *s > '9')
{
if (*s == '*') // 'match any'
{
// b[i] and m[i] to 0
s++;
if (!*s)
break;
s++;
continue;
}
G_Printf( "Bad filter address: %s\n", s );
return qfalse;
}
@ -103,7 +113,6 @@ static qboolean StringToFilter (char *s, ipFilter_t *f)
}
num[j] = 0;
b[i] = atoi(num);
if (b[i] != 0)
m[i] = 255;
if (!*s)
@ -125,21 +134,40 @@ UpdateIPBans
static void UpdateIPBans (void)
{
byte b[4] = {0};
int i;
char iplist[MAX_INFO_STRING] = {0};
byte m[4] = {0};
int i,j;
char iplist_final[MAX_CVAR_VALUE_STRING] = {0};
char ip[64] = {0};
*iplist = 0;
*iplist_final = 0;
for (i = 0 ; i < numIPFilters ; i++)
{
if (ipFilters[i].compare == 0xffffffff)
continue;
*(unsigned *)b = ipFilters[i].compare;
Com_sprintf( iplist + strlen(iplist), sizeof(iplist) - strlen(iplist),
"%i.%i.%i.%i ", b[0], b[1], b[2], b[3]);
*(unsigned *)m = ipFilters[i].mask;
*ip = 0;
for (j = 0 ; j < 4 ; j++)
{
if (m[j]!=255)
Q_strcat(ip, sizeof(ip), "*");
else
Q_strcat(ip, sizeof(ip), va("%i", b[j]));
Q_strcat(ip, sizeof(ip), (j<3) ? "." : " ");
}
if (strlen(iplist_final)+strlen(ip) < MAX_CVAR_VALUE_STRING)
{
Q_strcat( iplist_final, sizeof(iplist_final), ip);
}
else
{
Com_Printf("g_banIPs overflowed at MAX_CVAR_VALUE_STRING\n");
break;
}
}
trap_Cvar_Set( "g_banIPs", iplist );
trap_Cvar_Set( "g_banIPs", iplist_final );
}
/*
@ -212,7 +240,7 @@ G_ProcessIPBans
void G_ProcessIPBans(void)
{
char *s, *t;
char str[MAX_TOKEN_CHARS];
char str[MAX_CVAR_VALUE_STRING];
Q_strncpyz( str, g_banIPs.string, sizeof(str) );

View file

@ -764,7 +764,9 @@ int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) {
// Ok, let's do the player loop, hand out the bonuses
for (i = 0; i < g_maxclients.integer; i++) {
player = &g_entities[i];
if (!player->inuse)
// also make sure we don't award assist bonuses to the flag carrier himself.
if (!player->inuse || player == other)
continue;
if (player->client->sess.sessionTeam !=
@ -786,6 +788,7 @@ int Team_TouchOurFlag( gentity_t *ent, gentity_t *other, int team ) {
player->client->ps.eFlags &= ~(EF_AWARD_IMPRESSIVE | EF_AWARD_EXCELLENT | EF_AWARD_GAUNTLET | EF_AWARD_ASSIST | EF_AWARD_DEFEND | EF_AWARD_CAP );
player->client->ps.eFlags |= EF_AWARD_ASSIST;
player->client->rewardTime = level.time + REWARD_SPRITE_TIME;
}
if (player->client->pers.teamState.lastfraggedcarrier +
CTF_FRAG_CARRIER_ASSIST_TIMEOUT > level.time) {