Just inherit the Valve GameRules for MP now.
This commit is contained in:
parent
9931dac7c6
commit
08da7aa5bd
3 changed files with 2 additions and 145 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
#define CSQC
|
||||
#define CLIENT
|
||||
#define VALVE
|
||||
#define REWOLF
|
||||
#define CLASSIC_VGUI
|
||||
#define GS_RENDERFX
|
||||
|
||||
|
|
|
@ -1,142 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2020 Marco Hladik <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
void
|
||||
HLMultiplayerRules::FrameStart(void)
|
||||
{
|
||||
if (cvar("mp_timelimit") != 0)
|
||||
if (time >= (cvar("mp_timelimit") * 60)) {
|
||||
IntermissionStart();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
HLMultiplayerRules::CheckRules(void)
|
||||
{
|
||||
/* last person who killed somebody has hit the limit */
|
||||
if (g_dmg_eAttacker.frags >= cvar("mp_fraglimit"))
|
||||
IntermissionStart();
|
||||
}
|
||||
|
||||
void
|
||||
HLMultiplayerRules::PlayerDeath(base_player pp)
|
||||
{
|
||||
player pl = (player)pp;
|
||||
pl.movetype = MOVETYPE_NONE;
|
||||
pl.solid = SOLID_NOT;
|
||||
pl.takedamage = DAMAGE_NO;
|
||||
pl.gflags &= ~GF_FLASHLIGHT;
|
||||
pl.armor = pl.activeweapon = pl.g_items = 0;
|
||||
|
||||
pl.think = PutClientInServer;
|
||||
pl.nextthink = time + 4.0f;
|
||||
|
||||
if (pl.health < -50) {
|
||||
pl.health = 0;
|
||||
FX_GibHuman(pl.origin);
|
||||
return;
|
||||
}
|
||||
|
||||
pl.health = 0;
|
||||
|
||||
/* Let's handle corpses on the clientside */
|
||||
entity corpse = spawn();
|
||||
setorigin(corpse, pl.origin + [0,0,32]);
|
||||
setmodel(corpse, pl.model);
|
||||
setsize(corpse, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
corpse.movetype = MOVETYPE_TOSS;
|
||||
corpse.solid = SOLID_TRIGGER;
|
||||
corpse.modelindex = pl.modelindex;
|
||||
corpse.frame = ANIM_DIESIMPLE;
|
||||
corpse.angles = pl.angles;
|
||||
corpse.velocity = pl.velocity;
|
||||
corpse.colormap = pl.colormap;
|
||||
}
|
||||
|
||||
void
|
||||
HLMultiplayerRules::PlayerSpawn(base_player pp)
|
||||
{
|
||||
player pl = (player)pp;
|
||||
/* this is where the mods want to deviate */
|
||||
entity spot;
|
||||
|
||||
pl.classname = "player";
|
||||
pl.health = pl.max_health = 100;
|
||||
pl.takedamage = DAMAGE_YES;
|
||||
pl.solid = SOLID_SLIDEBOX;
|
||||
pl.movetype = MOVETYPE_WALK;
|
||||
pl.flags = FL_CLIENT;
|
||||
pl.viewzoom = 1.0;
|
||||
pl.model = "models/player.mdl";
|
||||
string mymodel = infokey(pl, "model");
|
||||
|
||||
if (mymodel) {
|
||||
mymodel = sprintf("models/player/%s/%s.mdl", mymodel, mymodel);
|
||||
if (whichpack(mymodel)) {
|
||||
pl.model = mymodel;
|
||||
}
|
||||
}
|
||||
setmodel(pl, pl.model);
|
||||
|
||||
setsize(pl, VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
pl.velocity = [0,0,0];
|
||||
pl.gravity = __NULL__;
|
||||
pl.frame = 1;
|
||||
pl.SendFlags = UPDATE_ALL;
|
||||
pl.customphysics = Empty;
|
||||
pl.iBleeds = TRUE;
|
||||
forceinfokey(pl, "*spec", "0");
|
||||
forceinfokey(pl, "*deaths", ftos(pl.deaths));
|
||||
|
||||
LevelNewParms();
|
||||
LevelDecodeParms(pl);
|
||||
|
||||
/*pl.g_items = ITEM_CROWBAR | ITEM_GLOCK | ITEM_SUIT;
|
||||
pl.activeweapon = WEAPON_GLOCK;
|
||||
pl.glock_mag = 18;
|
||||
pl.ammo_9mm = 44;*/
|
||||
|
||||
spot = Spawn_SelectRandom("info_player_deathmatch");
|
||||
setorigin(pl, spot.origin);
|
||||
pl.angles = spot.angles;
|
||||
Weapons_RefreshAmmo(pl);
|
||||
|
||||
Client_FixAngle(pl, pl.angles);
|
||||
}
|
||||
|
||||
float
|
||||
HLMultiplayerRules::ConsoleCommand(base_player pp, string cmd)
|
||||
{
|
||||
tokenize(cmd);
|
||||
|
||||
switch (argv(0)) {
|
||||
case "bot_add":
|
||||
Bot_AddQuick();
|
||||
break;
|
||||
default:
|
||||
return (0);
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
HLMultiplayerRules::HLMultiplayerRules(void)
|
||||
{
|
||||
/* these lines do nothing but tell the server to register those cvars */
|
||||
autocvar(mp_timelimit, 15, "Timelimit for multiplayer rounds");
|
||||
autocvar(mp_fraglimit, 15, "Points limit for multiplayer rounds");
|
||||
}
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
#define QWSSQC
|
||||
#define SERVER
|
||||
#define VALVE
|
||||
#define REWOLF
|
||||
#define GS_RENDERFX
|
||||
|
||||
|
@ -38,7 +37,7 @@ monster_trainingbot.qc
|
|||
|
||||
gamerules.qc
|
||||
../../../valve/src/server/gamerules_singleplayer.qc
|
||||
gamerules_multiplayer.qc
|
||||
../../../valve/src/server/gamerules_multiplayer.qc
|
||||
|
||||
../../../valve/src/server/client.qc
|
||||
../../../valve/src/server/server.qc
|
||||
|
|
Loading…
Reference in a new issue