TTT2 icon indicating copy to clipboard operation
TTT2 copied to clipboard

[Hotreload] Hotreload breaks shops

Open TimGoll opened this issue 2 years ago • 5 comments

Shops with standard items (not with manually selected items) are broken after hotreload. This is because the functions has to be called after a hotreload: https://github.com/TTT-2/TTT2/blob/master/gamemodes/terrortown/gamemode/client/cl_equip.lua#L1117-L1130

TimGoll avatar Oct 24 '23 16:10 TimGoll

It seems to be more tricky then expected. Things I've learned so far:

  • Recaching the materials on hotreload doesn't solve the issue. For items it works kind of (even though they are not buyable then), but weapons are stil not there
  • .material of all weapons is nil
  • AddEquipmentKeyValues is not called on hotreload, it sets up the equipment

TimGoll avatar Nov 17 '23 15:11 TimGoll

I tested this a lot as well and I think there was a problem in the TTT2RegisterSWEP part.

ZenBre4ker avatar Nov 17 '23 15:11 ZenBre4ker

I tested this a lot as well and I think there was a problem in the TTT2RegisterSWEP part.

yes, but it is hard to debug because all these functions seem to be called all over the place

TimGoll avatar Nov 17 '23 15:11 TimGoll

This here fixed the hotreload for weapon stats I remember: https://github.com/TTT-2/TTT2/commit/b72ae87d6b644280ec73d1f53506b9a5182da65a

ZenBre4ker avatar Nov 17 '23 15:11 ZenBre4ker

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 11 '24 10:02 stale[bot]