halflife icon indicating copy to clipboard operation
halflife copied to clipboard

[TFC] Spy disguise not working after map change

Open pizzahut2 opened this issue 13 years ago • 16 comments

On a fully updated SteamCmd Linux server without any plugins, it's not possible to disguise any more after a map change.

It can randomly start working again, but this isn't reproducible.

Protocol version 48 Exe version 1.1.2.2/Stdio (tfc) Exe build: 17:45:07 Apr 25 2013 (6027)

Updated with these commands:

app_set_config 90 mod tfc app_update 90 validate

Possibly related: bug fix for https://github.com/ValveSoftware/halflife/issues/1003

Another report here: http://steamcommunity.com/app/20/discussions/0/864975632348324162/

pizzahut2 avatar Aug 30 '13 23:08 pizzahut2

Not just Linux, windows too.

Protocol version 48 Exe version 1.1.2.2 (tfc) Exe build: 17:46:18 Apr 25 2013 (6027)

jolene-rv avatar Aug 31 '13 00:08 jolene-rv

Have you also tested it on TFC Beta using "app_update 90 -beta beta validate"? Just to compare the difference.

APGRoboCop avatar Aug 31 '13 10:08 APGRoboCop

RoboCop, I did some testing just now, same issue in the beta.

] rcon version Protocol version 48 Exe version 1.1.2.2/Stdio (tfc) Exe build: 10:03:21 Aug 8 2013 (6132)

Also did some testing on your servers. The bug appears on AvD and CTF, but not on Dusty4Ever (a dustbowl 24/7 server, so always same map).

pizzahut2 avatar Aug 31 '13 13:08 pizzahut2

Alfred, could you please increase priority for this bug and for https://github.com/ValveSoftware/halflife/issues/1070 (shooting multiple projectiles at once), I think these are the most annoying ones right now.

pizzahut2 avatar Jan 01 '14 12:01 pizzahut2

So 10 months later from the last post, and over a year from posting, is there any news on a fix for the two major bugs introduced during SteamCMD - double fire and spy disguises?

ghost avatar Oct 08 '14 01:10 ghost

It looks like CBasePlayer::flLastDisguesChange in CBasePlayer;;TeamFortress_SpyDisguise() is not reset.

Code starts like this:

if (gpGlobals->time - CBasePlayer::flLastDisguesChange >= 1.0)
{
    CBasePlayer::flLastDisguesChange = gpGlobals->time;

I would assume at map change, flLastDisguesChange holds the previous value, and thus, the check won't be true unless gpGlobals->time unless value is > to previous value of flLastDisguesChange + 1.

Arkshine avatar Mar 28 '15 17:03 Arkshine

This bug is very much still an issue in the current stable version and is affecting a surge of players from the latest Steam Summer Sale.

Protocol version 48 Exe version 1.1.2.2/Stdio (tfc) Exe build: 13:12:29 Aug 29 2013 (6153)

Concerning the sourcecode @Arkshine is quoting, I can't seem to find public reference to that. Is TFC itself closed source?

dazultra avatar Jul 04 '16 08:07 dazultra

Team Fortress Classic is closed source but the snippet is probably from reverse engineering the Linux server .so Is it possible to fix this with a plugin?

tschumann avatar Jul 05 '16 10:07 tschumann

Arkshine is correct. flLastDisguesChange is a static local variable in the disguise function. It's never reset (and can't be reset since it's only accessible to that function) so it will stay at its last value from the previous map.

It's odd that they're using a static local for this. I'd have thought a member variable would be better suited here, since this affects all spies. If you timed it right, you could detect when another spy is disguising.

It's easy to fix and test, so hopefully whoever is assigned to this issue now will fix it.

SamVanheer avatar Aug 19 '16 13:08 SamVanheer

this bug still seems to be prevalent. i experience it on some servers, and not on others. what is the fix?

thanks.

battlemint avatar Jul 01 '17 02:07 battlemint

@battlemint The work-around is to use an old binary for TFC, from before SteamCMD was rolled out.

https://web.archive.org/web/20150418185206/http://forums.steampowered.com/forums/showthread.php?p=35217128

pizzahut2 avatar Aug 25 '17 12:08 pizzahut2

Thank you, pizzahut!

battlemint avatar Aug 27 '17 05:08 battlemint

Can someone confirm whether this is fixed now? After today's update, I tried reproducing the bug on Windows with listen server (TFC main menu), SteamCMD and Steam Tools (Steam library). The bug didn't occur.

The double shoot bug is still present though.

pizzahut2 avatar Jun 19 '18 20:06 pizzahut2

Looks like it, there's code to reset the disguise time if it's greater than the current time:

  if ( flLastDisguesChange > gpGlobals->time )
  {
    lLastDisguesChange = 0;
  }

We may get some fixes after all.

SamVanheer avatar Jun 19 '18 20:06 SamVanheer

I have no idea how I "unassigned alfred-valve". But as it's fixed now anyway, no matter. Closing issue.

pizzahut2 avatar Jun 19 '18 21:06 pizzahut2

How is that possible?

APGRoboCop avatar Jun 19 '18 21:06 APGRoboCop