Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix vending_products register continue check (#4962)
# About the pull request This PR cherry picks cmss13-devs/cmss13-pve#68 but removes the extra logging. That PR was attempting to resolve server hitching, but the hitching seems to have gone away with it and a TGS update. I am not currently able to discern any noticeable differences from this change, however the change looks correct for the continue check to ever work correctly. See Testing Notes below. Let me know if you do find a change this does improve, or maybe somewhere else we should expect superfluous calls to getFlatIcon. # Explain why it's good for the game The continue check as written looks like it would never work, whereas now the string that will be used for inserting into the list sprites is the same string we check before creating new icons. # Testing Photographs and Procedure <details> <summary>Testing Notes</summary> Debugging only: Lobby (LV-624): One event of registering (master -> init Assets -> vending_products) 55 getFlatIcon calls (.124 total cpu) Game Start: No changes After opening CO vendors and cig vendor: No changes Alt+click self: 77 getFlatIcon calls (.353 total cpu) Alt+click self again: No changes ----- After continue change: Lobby (LV-624): One event of registering (master -> init Assets -> vending_products) 55 getFlatIcon calls (.117 total cpu) Game Start: No changes After opening CO vendors and cig vendor: No changes Alt+click self: 77 getFlatIcon calls (.346 total cpu) Alt+click self again: No changes ------ Debugging only w/ SVN: Lobby (LV-624): One event of registering (master -> init Assets -> vending_products) 55 getFlatIcon calls (.124 total cpu) Game Start: No changes After opening CO vendors and cig vendor: a GET was performed for first CO vendor and first cig vendor opened (never again) Alt+click self: 77 getFlatIcon calls (.351 total cpu) A GET is performed for every item listed Alt+click self again: A GET is performed for every item listed ----- After continue change w/ SVN: Lobby (LV-624): One event of registering (master -> init Assets -> vending_products) 55 getFlatIcon calls (.120 total cpu) Game Start: No changes After opening CO vendors and cig vendor: a GET was performed for first CO vendor and first cig vendor opened (never again) Alt+click self: 77 getFlatIcon calls (.347 total cpu) A GET is performed for every item listed Alt+click self again: A GET is performed for every item listed </details> # Changelog :cl: Morrow code: Corrected a check to avoid repeat work in /datum/asset/spritesheet/vending_products/register() /:cl: --------- Co-authored-by: Morrow <[email protected]>
- Loading branch information