Clean up think calls and fix various linking issues with upstream Nuclide.
This commit is contained in:
parent
269d16eac6
commit
131228db92
9 changed files with 21 additions and 76 deletions
|
@ -27,26 +27,6 @@ Game_RunClientCommand(void)
|
||||||
pl.Physics_Run();
|
pl.Physics_Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* custom chat packet */
|
|
||||||
void
|
|
||||||
SV_SendChat(entity sender, string msg, entity eEnt, float fType)
|
|
||||||
{
|
|
||||||
WriteByte(MSG_MULTICAST, SVC_CGAMEPACKET);
|
|
||||||
WriteByte(MSG_MULTICAST, fType == 0 ? EV_CHAT:EV_CHAT_TEAM);
|
|
||||||
WriteByte(MSG_MULTICAST, num_for_edict(sender) - 1);
|
|
||||||
WriteByte(MSG_MULTICAST, sender.team);
|
|
||||||
WriteString(MSG_MULTICAST, msg);
|
|
||||||
|
|
||||||
if (eEnt) {
|
|
||||||
msg_entity = eEnt;
|
|
||||||
multicast([0,0,0], MULTICAST_ONE);
|
|
||||||
} else {
|
|
||||||
multicast([0,0,0], MULTICAST_ALL);
|
|
||||||
}
|
|
||||||
|
|
||||||
localcmd(sprintf("echo [SERVER] %s: %s\n", sender.netname, msg));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* client cmd overrides happen here */
|
/* client cmd overrides happen here */
|
||||||
void
|
void
|
||||||
Game_ParseClientCommand(string cmd)
|
Game_ParseClientCommand(string cmd)
|
||||||
|
@ -64,18 +44,5 @@ Game_ParseClientCommand(string cmd)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argv(0) == "say") {
|
|
||||||
SV_SendChat(self, argv(1), world, 0);
|
|
||||||
return;
|
|
||||||
} else if (argv(0) == "say_team") {
|
|
||||||
entity a;
|
|
||||||
for (a = world; (a = find(a, ::classname, "player"));) {
|
|
||||||
if (a.team == self.team) {
|
|
||||||
SV_SendChat(self, argv(1), a, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clientcommand(self, cmd);
|
clientcommand(self, cmd);
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,8 +159,7 @@ TFCDispenser::Replenish(void)
|
||||||
m_iCells += 1;
|
m_iCells += 1;
|
||||||
m_iArmor += 1;
|
m_iArmor += 1;
|
||||||
ClampValues();
|
ClampValues();
|
||||||
|
ScheduleThink(Replenish, 1.0f);
|
||||||
nextthink = time + 1.0f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -229,8 +228,7 @@ TFCDispenser::Place(player pl)
|
||||||
SetOrigin(pl.origin + (v_forward * 48));
|
SetOrigin(pl.origin + (v_forward * 48));
|
||||||
DropToFloor();
|
DropToFloor();
|
||||||
|
|
||||||
think = FinishPlacing;
|
ScheduleThink(FinishPlacing, 5.0f);
|
||||||
nextthink = time + 5.0f;
|
|
||||||
real_owner = pl;
|
real_owner = pl;
|
||||||
colormap = pl.colormap;
|
colormap = pl.colormap;
|
||||||
|
|
||||||
|
@ -243,9 +241,7 @@ TFCDispenser::FinishPlacing(void)
|
||||||
{
|
{
|
||||||
env_message_single(real_owner, "#Dispenser_finish");
|
env_message_single(real_owner, "#Dispenser_finish");
|
||||||
Sound_Play(this, CHAN_BODY, "engineer.turret_set");
|
Sound_Play(this, CHAN_BODY, "engineer.turret_set");
|
||||||
|
ScheduleThink(Replenish, 1.0f);
|
||||||
think = Replenish;
|
|
||||||
nextthink = time + 1.0f;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -103,8 +103,7 @@ TFCGameRules::PlayerDeath(NSClientPlayer pp)
|
||||||
pl.SetSolid(SOLID_NOT);
|
pl.SetSolid(SOLID_NOT);
|
||||||
pl.SetMovetype(MOVETYPE_NONE);
|
pl.SetMovetype(MOVETYPE_NONE);
|
||||||
|
|
||||||
pl.think = TFCGameRules_PlayerRespawn;
|
pl.ScheduleThink(TFCGameRules_PlayerRespawn, 4.0f);
|
||||||
pl.nextthink = time + 4.0f;
|
|
||||||
|
|
||||||
/* play the iconic death sound */
|
/* play the iconic death sound */
|
||||||
Sound_Play(pl, CHAN_VOICE, "player_tfc.death");
|
Sound_Play(pl, CHAN_VOICE, "player_tfc.death");
|
||||||
|
|
|
@ -253,11 +253,8 @@ info_tfgoal::Touch(entity eToucher)
|
||||||
|
|
||||||
/* remove? */
|
/* remove? */
|
||||||
if (m_tfgResult & TFRESULT_REMOVE) {
|
if (m_tfgResult & TFRESULT_REMOVE) {
|
||||||
Hide();
|
Disappear();
|
||||||
if (m_dRespawn) {
|
ScheduleThink(Respawn, m_dRespawn);
|
||||||
think = Respawn;
|
|
||||||
nextthink = time + m_dRespawn;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,17 +415,10 @@ class i_t_g:info_tfgoal
|
||||||
void
|
void
|
||||||
i_t_g::Respawn(void)
|
i_t_g::Respawn(void)
|
||||||
{
|
{
|
||||||
solid = SOLID_BSPTRIGGER;
|
SetSolid(SOLID_BSPTRIGGER);
|
||||||
movetype = MOVETYPE_NONE;
|
SetMovetype(MOVETYPE_NONE);
|
||||||
SetModel(GetSpawnModel());
|
SetModel(GetSpawnModel());
|
||||||
SetOrigin(GetSpawnOrigin());
|
SetOrigin(GetSpawnOrigin());
|
||||||
|
|
||||||
/* TODO: Investigate instead whether or not we use a trigger texture? */
|
|
||||||
/*if (substring(model, 0, 1) == "*") { */
|
|
||||||
SetRenderMode(RM_TRIGGER);
|
|
||||||
/*} else {
|
|
||||||
SetRenderMode(RM_NORMAL);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -124,9 +124,8 @@ item_armor::Touch(entity eToucher)
|
||||||
Sound_Play(this, CHAN_ITEM, "item_armor_tfc.pickup");
|
Sound_Play(this, CHAN_ITEM, "item_armor_tfc.pickup");
|
||||||
|
|
||||||
/* hide and respawn */
|
/* hide and respawn */
|
||||||
Hide();
|
Disappear();
|
||||||
think = Respawn;
|
ScheduleThink(Respawn, m_flRespawnDelay);
|
||||||
nextthink = time + m_flRespawnDelay;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -63,9 +63,8 @@ item_healthkit::Touch(entity eToucher)
|
||||||
Sound_Play(this, CHAN_ITEM, "item_healthkit_tfc.pickup");
|
Sound_Play(this, CHAN_ITEM, "item_healthkit_tfc.pickup");
|
||||||
|
|
||||||
/* hide and respawn */
|
/* hide and respawn */
|
||||||
Hide();
|
Disappear();
|
||||||
think = Respawn;
|
ScheduleThink(Respawn, m_flRespawnDelay);
|
||||||
nextthink = time + m_flRespawnDelay;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -113,8 +113,7 @@ item_tfgoal::DropReturnable(NSClientPlayer pp)
|
||||||
pl.g_items &= ~ITEM_GOALITEM;
|
pl.g_items &= ~ITEM_GOALITEM;
|
||||||
|
|
||||||
/* return after N secs */
|
/* return after N secs */
|
||||||
think = TeamOwnerReturns;
|
ScheduleThink(TeamOwnerReturns, m_flPausetime);
|
||||||
nextthink = time + m_flPausetime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -153,11 +152,10 @@ item_tfgoal::Touch(entity eToucher)
|
||||||
if (m_iTeamUses != pl.team)
|
if (m_iTeamUses != pl.team)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Hide();
|
Disappear();
|
||||||
pl.g_items |= ITEM_GOALITEM;
|
pl.g_items |= ITEM_GOALITEM;
|
||||||
m_eActivator = pl;
|
m_eActivator = pl;
|
||||||
think = __NULL__;
|
ReleaseThink();
|
||||||
nextthink = 0.0f;
|
|
||||||
|
|
||||||
sound(this, CHAN_ITEM, m_strSound, 1.0f, ATTN_NONE);
|
sound(this, CHAN_ITEM, m_strSound, 1.0f, ATTN_NONE);
|
||||||
|
|
||||||
|
@ -214,8 +212,7 @@ item_tfgoal::Respawn(void)
|
||||||
SetSolid(SOLID_TRIGGER);
|
SetSolid(SOLID_TRIGGER);
|
||||||
SetOrigin(GetSpawnOrigin());
|
SetOrigin(GetSpawnOrigin());
|
||||||
m_eActivator = __NULL__;
|
m_eActivator = __NULL__;
|
||||||
think = __NULL__;
|
ReleaseThink();
|
||||||
nextthink = 0.0f;
|
|
||||||
m_status = GISTATUS_HOME;
|
m_status = GISTATUS_HOME;
|
||||||
SetRenderFX(RFX_GLOWSHELL);
|
SetRenderFX(RFX_GLOWSHELL);
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
void
|
void
|
||||||
TFCSentry::Think(void)
|
TFCSentry::Think(void)
|
||||||
{
|
{
|
||||||
nextthink = time + 0.1f;
|
ScheduleThink(Think 0.1f);
|
||||||
|
|
||||||
/* searching */
|
/* searching */
|
||||||
entity t = world;
|
entity t = world;
|
||||||
|
@ -77,8 +77,7 @@ TFCSentry::Place(NSClientPlayer pl)
|
||||||
SetOrigin(pl.origin + (v_forward * 48));
|
SetOrigin(pl.origin + (v_forward * 48));
|
||||||
DropToFloor();
|
DropToFloor();
|
||||||
|
|
||||||
think = FinishPlacing;
|
ScheduleThink(FinishPlacing, 5.0f);
|
||||||
nextthink = time + 5.0f;
|
|
||||||
real_owner = pl;
|
real_owner = pl;
|
||||||
colormap = pl.colormap;
|
colormap = pl.colormap;
|
||||||
|
|
||||||
|
@ -97,8 +96,8 @@ TFCSentry::FinishPlacing(void)
|
||||||
m_eHead.SetSize([-16,-16,0], [16,16,32]);
|
m_eHead.SetSize([-16,-16,0], [16,16,32]);
|
||||||
m_eHead.SetOrigin(GetOrigin() + [0,0,20]);
|
m_eHead.SetOrigin(GetOrigin() + [0,0,20]);
|
||||||
m_eHead.colormap = colormap;
|
m_eHead.colormap = colormap;
|
||||||
think = Think;
|
|
||||||
nextthink = time + 0.1f;
|
ScheduleThink(Think, 0.1f);
|
||||||
m_state = SENTRY_SEARCHING;
|
m_state = SENTRY_SEARCHING;
|
||||||
m_flNextIdleSound = time + 5.0f;
|
m_flNextIdleSound = time + 5.0f;
|
||||||
|
|
||||||
|
|
|
@ -75,9 +75,8 @@ TFCTeleporter::Place(player pl)
|
||||||
makevectors([0, pl.v_angle[1], 0]);
|
makevectors([0, pl.v_angle[1], 0]);
|
||||||
SetOrigin(pl.origin + (v_forward * 48));
|
SetOrigin(pl.origin + (v_forward * 48));
|
||||||
DropToFloor();
|
DropToFloor();
|
||||||
|
ScheduleThink(FinishPlacing, 5.0f);
|
||||||
|
|
||||||
think = FinishPlacing;
|
|
||||||
nextthink = time + 5.0f;
|
|
||||||
real_owner = pl;
|
real_owner = pl;
|
||||||
colormap = pl.colormap;
|
colormap = pl.colormap;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue