Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vending product asset transfer tweaks and testing #68

Merged
merged 3 commits into from
Nov 20, 2023

Conversation

morrowwolf
Copy link
Member

I suspect something is re-registering vending products. Not sure though.

Secondly, while looking into this I believe I found the check for an already existing sprite on line 323 of asset_list_items.dm is actually incorrect and should be the imgid rather than the icon. I think...

@morrowwolf morrowwolf enabled auto-merge (squash) November 20, 2023 05:15
@morrowwolf morrowwolf merged commit 3c0487a into master Nov 20, 2023
29 checks passed
@morrowwolf morrowwolf deleted the vending-asset-transfer-tweaks branch November 23, 2023 22:40
github-merge-queue bot pushed a commit to cmss13-devs/cmss13 that referenced this pull request Dec 1, 2023
# 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant