Update 1 changes

This commit is contained in:
Mike Rubits
2023-10-03 14:43:06 -04:00
parent 60f29560f3
commit 8dc1fc9794
67 changed files with 1806 additions and 1479 deletions

View File

@@ -3,7 +3,7 @@
#include "g_local.h"
#include "m_player.h"
void SelectNextItem(edict_t *ent, item_flags_t itflags)
void SelectNextItem(edict_t *ent, item_flags_t itflags, bool menu = true)
{
gclient_t *cl;
item_id_t i, index;
@@ -12,12 +12,12 @@ void SelectNextItem(edict_t *ent, item_flags_t itflags)
cl = ent->client;
// ZOID
if (cl->menu)
if (menu && cl->menu)
{
PMenu_Next(ent);
return;
}
else if (cl->chase_target)
else if (menu && cl->chase_target)
{
ChaseNext(ent);
return;
@@ -96,7 +96,7 @@ void ValidateSelectedItem(edict_t *ent)
if (cl->pers.inventory[cl->pers.selected_item])
return; // valid
SelectNextItem(ent, IF_ANY);
SelectNextItem(ent, IF_ANY, false);
}
//=================================================================================
@@ -456,7 +456,7 @@ void Cmd_Spawn_f(edict_t *ent)
if (other->inuse)
gi.linkentity(other);
if (other->svflags & SVF_MONSTER)
if ((other->svflags & SVF_MONSTER) && other->think)
other->think(other);
}
@@ -490,6 +490,19 @@ void Cmd_Teleport_f(edict_t *ent)
ent->s.origin[0] = (float) atof(gi.argv(1));
ent->s.origin[1] = (float) atof(gi.argv(2));
ent->s.origin[2] = (float) atof(gi.argv(3));
if (gi.argc() >= 4)
{
float pitch = (float) atof(gi.argv(4));
float yaw = (float) atof(gi.argv(5));
float roll = (float) atof(gi.argv(6));
vec3_t ang { pitch, yaw, roll };
ent->client->ps.pmove.delta_angles = ( ang - ent->client->resp.cmd_angles );
ent->client->ps.viewangles = {};
ent->client->v_angle = {};
}
gi.linkentity(ent);
}
@@ -660,10 +673,16 @@ void Cmd_Drop_f(edict_t *ent)
return;
// ZOID--special case for tech powerups
if (Q_strcasecmp(gi.args(), "tech") == 0 && (it = CTFWhat_Tech(ent)) != nullptr)
if (Q_strcasecmp(gi.args(), "tech") == 0)
{
it->drop(ent, it);
ValidateSelectedItem(ent);
it = CTFWhat_Tech(ent);
if (it)
{
it->drop(ent, it);
ValidateSelectedItem(ent);
}
return;
}
// ZOID
@@ -1033,7 +1052,7 @@ void Cmd_Where_f( edict_t * ent ) {
const vec3_t & origin = ent->s.origin;
std::string location;
fmt::format_to( std::back_inserter( location ), FMT_STRING( "{:.1f} {:.1f} {:.1f}\n" ), origin[ 0 ], origin[ 1 ], origin[ 2 ] );
fmt::format_to( std::back_inserter( location ), FMT_STRING( "{:.1f} {:.1f} {:.1f} {:.1f} {:.1f} {:.1f}\n" ), origin[ 0 ], origin[ 1 ], origin[ 2 ], ent->client->ps.viewangles[0], ent->client->ps.viewangles[1], ent->client->ps.viewangles[2] );
gi.LocClient_Print( ent, PRINT_HIGH, "Location: {}\n", location.c_str() );
gi.SendToClipBoard( location.c_str() );
}
@@ -1212,9 +1231,7 @@ void Cmd_Wave_f(edict_t *ent)
if (do_animate)
ent->client->anim_priority = ANIM_WAVE;
constexpr float NOTIFY_DISTANCE = 256.f;
bool notified_anybody = false;
const char *self_notify_msg = nullptr, *other_notify_msg = nullptr, *other_notify_none_msg = nullptr;
const char *other_notify_msg = nullptr, *other_notify_none_msg = nullptr;
vec3_t start, dir;
P_ProjectSource(ent, ent->client->v_angle, { 0, 0, 0 }, start, dir);
@@ -1245,7 +1262,6 @@ void Cmd_Wave_f(edict_t *ent)
switch (i)
{
case GESTURE_FLIP_OFF:
self_notify_msg = "$g_flipoff";
other_notify_msg = "$g_flipoff_other";
other_notify_none_msg = "$g_flipoff_none";
if (do_animate)
@@ -1255,7 +1271,6 @@ void Cmd_Wave_f(edict_t *ent)
}
break;
case GESTURE_SALUTE:
self_notify_msg = "$g_salute";
other_notify_msg = "$g_salute_other";
other_notify_none_msg = "$g_salute_none";
if (do_animate)
@@ -1265,7 +1280,6 @@ void Cmd_Wave_f(edict_t *ent)
}
break;
case GESTURE_TAUNT:
self_notify_msg = "$g_taunt";
other_notify_msg = "$g_taunt_other";
other_notify_none_msg = "$g_taunt_none";
if (do_animate)
@@ -1275,7 +1289,6 @@ void Cmd_Wave_f(edict_t *ent)
}
break;
case GESTURE_WAVE:
self_notify_msg = "$g_wave";
other_notify_msg = "$g_wave_other";
other_notify_none_msg = "$g_wave_none";
if (do_animate)
@@ -1286,7 +1299,6 @@ void Cmd_Wave_f(edict_t *ent)
break;
case GESTURE_POINT:
default:
self_notify_msg = "$g_point";
other_notify_msg = "$g_point_other";
other_notify_none_msg = "$g_point_none";
if (do_animate)
@@ -1336,7 +1348,7 @@ void Cmd_Wave_f(edict_t *ent)
gi.WriteShort(POI_PING + (ent->s.number - 1));
gi.WriteShort(5000);
gi.WritePosition(tr.endpos);
gi.WriteShort(gi.imageindex("loc_ping"));
gi.WriteShort(level.pic_ping);
gi.WriteByte(208);
gi.WriteByte(POI_FLAG_NONE);
gi.unicast(player, false);