Skip to content

Commit 4e9ffc5

Browse files
NickCloudATTimGoll
andauthored
Shopeditor: Item Buyability Broken due to Cache State (#1621)
This pullrequest fixes the issue where items (not weapons) had the wrong state if a custom show was created. This means that they were always marked as selected, even if they weren't. This was due to the caching being done too early, before the items were initialized at all. The issue didn't exist for weapons because their setup is done in the engine before any lua init code is executed. --------- Co-authored-by: Tim Goll <[email protected]>
1 parent dd63d89 commit 4e9ffc5

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
120120
- Fixed avatar icons not refreshing if they were changed on Steam (by @mexikoedi)
121121
- Fixed a wrong label for the sprint speed multiplier in the F1 menu (by @TimGoll)
122122
- Fixed own player name being shown in targetID when in vehicle (by @TimGoll)
123+
- Fixed `ShopEditor.BuildValidEquipmentCache()` being called too early on the client, resulting in a wrong cache state (by @NickCloudAT and @12problems)
123124

124125
### Removed
125126

gamemodes/terrortown/gamemode/client/cl_changes.lua

+1
Original file line numberDiff line numberDiff line change
@@ -2190,6 +2190,7 @@ function CreateChanges()
21902190
<li>Avatar icons not refreshing if they were changed on Steam</li>
21912191
<li>A wrong label for the sprint speed multiplier in the F1 menu</li>
21922192
<li>Own player name being shown in targetID when in vehicle</li>
2193+
<li>Fixed <code>ShopEditor.BuildValidEquipmentCache()</code> being called too early on the client, resulting in a wrong cache state</li>
21932194
</ul>
21942195
<h2>Removed</h2>
21952196
<ul>

gamemodes/terrortown/gamemode/client/cl_main.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ function GM:Initialize()
206206

207207
keyhelp.InitializeBasicKeys()
208208

209-
ShopEditor.BuildValidEquipmentCache()
210-
211209
tips.Initialize()
212210

213211
---
@@ -292,6 +290,8 @@ function GM:InitPostEntity()
292290
-- initialize fallback shops
293291
InitFallbackShops()
294292

293+
ShopEditor.BuildValidEquipmentCache()
294+
295295
---
296296
-- @realm client
297297
-- stylua: ignore

0 commit comments

Comments
 (0)