TTT-2 / TTT2

Trouble in Terrorist Town 2 for Garry's Mod (gmod)
https://steamcommunity.com/sharedfiles/filedetails/?id=1357204556
178 stars 74 forks source link

Binoculars script error #1240

Closed mexikoedi closed 9 months ago

mexikoedi commented 10 months ago

Your version of TTT2 (mandatory)

Describe the bug (mandatory)

When the binoculars are bought from the shop an error appears. The binoculars work fine and do not create any errors after the first error. Noticed this error with the TTT2 0.12.X version, it wasn't present with prior versions.

To reproduce

Steps to reproduce the behaviour:

  1. Go into a round
  2. Spawn as a detective
  3. Buy binoculars
  4. See error

Expected behaviour

Error shouldn't appear when buying the binoculars from the shop.

Context (please provide as much as you can)

[ERROR] lua/includes/extensions/entity.lua:240: bad argument #3 to 'SetFunc' (number expected, got boolean)
  1. SetFunc - [C]:-1
   2. __newindex - lua/includes/extensions/entity.lua:240
    3. SetZoom - lua/includes/extensions/entity.lua:328
     4. unknown - gamemodes/terrortown/entities/weapons/weapon_tttbase.lua:1037
      5. plymeta_old_Give - [C]:-1
       6. Give - gamemodes/terrortown/gamemode/server/sv_player_ext.lua:1260
        7. GiveEquipmentWeapon - gamemodes/terrortown/gamemode/server/sv_player_ext.lua:443
         8. OrderEquipment - gamemodes/terrortown/gamemode/server/sv_shop.lua:169
          9. func - gamemodes/terrortown/gamemode/server/sv_shop.lua:205
           10. unknown - lua/includes/extensions/net.lua:38
EntranceJew commented 10 months ago

I tried this out just now on the HEAD of master, and didn't encounter such a problem. I don't know why this would be.

mexikoedi commented 10 months ago

I tried this out just now on the HEAD of master, and didn't encounter such a problem. I don't know why this would be.

I tried it on a P2P server with only TTT2 Base from the Steam Workshop and encountered this issue. I also tried restarting Gmod and also removed my addons from the addons folders but it didn't solve this.

mexikoedi commented 10 months ago

So I just tried it on my dedicated server with my collection and also got this error.