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

Fixed clientside items in co-op not copying properties properly #2497

Merged
merged 1 commit into from Apr 15, 2024

Conversation

Boondorl
Copy link
Contributor

E.g. ammo dropped by monsters not being halved.

@coelckers
Copy link
Member

Can you please explain the problem and solution in more detail? I don't understand the technical side of the problem you want to solve and why you need to alter the signature of CreateCopy to fix it.

@Boondorl
Copy link
Contributor Author

Boondorl commented Apr 15, 2024

When "clientside" items are enabled in online play, picking up an item gives a copy of itself rather than the direct item. Originally I just spawned an entirely new item but forgot that sometimes an item will realistically modify its own properties before giving itself (e.g. an enemy will halve ammo drops). CreateCopy is the only reasonable way to handle this but I need to guarantee it spawns a new copy.

Realistically this could probably be moved to GoAway and some kind of protected flag i.e. bCreatingCopy. I assumed GoAway was a virtual function but looking closer it seems to be a standard one that merely calls a bunch of virtuals.

Edit: Tweaked it. This version is much less invasive.

Revert "Fixed local items not copying properties properly"

This reverts commit 5f352df.

...
@coelckers
Copy link
Member

This is definitely better because it will still work with existing CreateCopy overrides that dont know about the change you made.

@coelckers coelckers merged commit 70a165b into ZDoom:master Apr 15, 2024
10 checks passed
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.

None yet

2 participants