From b5ce9a57bc43d37cfcfef0e465a5bcb45927ac76 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Mon, 19 Aug 2019 03:06:34 -0700 Subject: [PATCH] Makefile: Create directories for mod prog output --- Source/Makefile | 4 ++++ Source/client/valve/player.c | 10 +++++----- Source/server/valve/player.c | 26 +++++++++++++++++++++----- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Source/Makefile b/Source/Makefile index e09e567e..dfab9fe8 100644 --- a/Source/Makefile +++ b/Source/Makefile @@ -2,11 +2,15 @@ CC=fteqcc qc-progs: $(CC) menu-fn/progs.src + mkdir -p ../valve/data.pk3dir $(CC) client/valve.src $(CC) server/valve.src + mkdir -p ../scihunt/data.pk3dir $(CC) client/scihunt.src $(CC) server/scihunt.src + mkdir -p ../cstrike/data.pk3dir $(CC) client/cstrike.src $(CC) server/cstrike.src + mkdir -p ../rewolf/data.pk3dir $(CC) client/rewolf.src $(CC) server/rewolf.src diff --git a/Source/client/valve/player.c b/Source/client/valve/player.c index 44bf55a9..a21d1b0a 100644 --- a/Source/client/valve/player.c +++ b/Source/client/valve/player.c @@ -16,16 +16,16 @@ void Player_ReadEntity(float flIsNew) pl.drawmask = MASK_ENGINE; pl.customphysics = Empty; setsize( pl, VEC_HULL_MIN, VEC_HULL_MAX ); - pl.set_model(); + pl.set_model(getplayerkeyvalue(pl.entnum - 1, "model")); } readshort(); pl.origin[0] = readcoord(); pl.origin[1] = readcoord(); pl.origin[2] = readcoord(); - pl.pitch = readcoord(); - pl.angles[1] = readcoord(); - pl.angles[2] = readcoord(); + pl.pitch = readfloat(); + pl.angles[1] = readfloat(); + pl.angles[2] = readfloat(); pl.velocity[0] = readcoord(); pl.velocity[1] = readcoord(); pl.velocity[2] = readcoord(); @@ -34,7 +34,7 @@ void Player_ReadEntity(float flIsNew) pl.g_items = readfloat(); pl.health = readbyte(); pl.armor = readbyte(); - pl.movetype = readfloat(); + pl.movetype = readbyte(); pl.view_ofs[2] = readfloat(); pl.viewzoom = readfloat(); pl.jumptime = readfloat(); diff --git a/Source/server/valve/player.c b/Source/server/valve/player.c index d1a3295c..1e3c4d90 100644 --- a/Source/server/valve/player.c +++ b/Source/server/valve/player.c @@ -18,7 +18,23 @@ void Player_Death(int hit) pl.solid = SOLID_NOT; pl.takedamage = DAMAGE_NO; pl.health = pl.armor = pl.activeweapon = pl.g_items = 0; - PutClientInServer(); + + pl.think = PutClientInServer; + pl.nextthink = time + 4.0f; + sound(pl, CHAN_AUTO, "fvox/flatline.wav", 1.0, ATTN_NORM); + + /* Let's handle corpses on the clientside */ + WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET); + WriteByte(MSG_MULTICAST, EV_CORPSE); + WriteByte(MSG_MULTICAST, num_for_edict(pl) - 1); + WriteCoord(MSG_MULTICAST, pl.origin[0]); + WriteCoord(MSG_MULTICAST, pl.origin[1]); + WriteCoord(MSG_MULTICAST, pl.origin[2]); + WriteCoord(MSG_MULTICAST, pl.angles[0]); + WriteCoord(MSG_MULTICAST, pl.angles[1]); + WriteCoord(MSG_MULTICAST, pl.angles[2]); + msg_entity = pl; + multicast(pl.origin, MULTICAST_PVS); } /* @@ -97,9 +113,9 @@ float Player_SendEntity(entity ePEnt, float fChanged) WriteCoord(MSG_ENTITY, pl.origin[0]); WriteCoord(MSG_ENTITY, pl.origin[1]); WriteCoord(MSG_ENTITY, pl.origin[2]); - WriteCoord(MSG_ENTITY, pl.v_angle[0]); - WriteCoord(MSG_ENTITY, pl.angles[1]); - WriteCoord(MSG_ENTITY, pl.angles[2]); + WriteFloat(MSG_ENTITY, pl.v_angle[0]); + WriteFloat(MSG_ENTITY, pl.angles[1]); + WriteFloat(MSG_ENTITY, pl.angles[2]); WriteCoord(MSG_ENTITY, pl.velocity[0]); WriteCoord(MSG_ENTITY, pl.velocity[1]); WriteCoord(MSG_ENTITY, pl.velocity[2]); @@ -108,7 +124,7 @@ float Player_SendEntity(entity ePEnt, float fChanged) WriteFloat(MSG_ENTITY, pl.g_items); WriteByte(MSG_ENTITY, pl.health); WriteByte(MSG_ENTITY, pl.armor); - WriteFloat(MSG_ENTITY, pl.movetype); + WriteByte(MSG_ENTITY, pl.movetype); WriteFloat(MSG_ENTITY, pl.view_ofs[2]); WriteFloat(MSG_ENTITY, pl.viewzoom); WriteFloat(MSG_ENTITY, pl.jumptime);