Fix #5222, #5223, #5224: Wire missing element getter/setter types - #5227
Open
x6c85 wants to merge 1 commit into
Open
Fix #5222, #5223, #5224: Wire missing element getter/setter types#5227x6c85 wants to merge 1 commit into
x6c85 wants to merge 1 commit into
Conversation
…re missing element getter/setter types get/setElementAlpha, is/setElementFrozen and getElementCollisionsEnabled returned false for building, weapon and projectile even when the matching setters already worked. Handle those types in the element helpers so scripts can read and write the properties.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getElementAlpha/setElementAlpha,isElementFrozen/setElementFrozenandgetElementCollisionsEnabledwere missing building, weapon and projectile in their type switches, so they returnedfalseeven when the matching setter already worked.CClientWeaponalready inherits object alpha)Motivation
Fixes #5222, #5223 and #5224.
crun b = createBuilding(1337, me.position)thenb.alpha/getElementCollisionsEnabled(b)returned false.createProjectilethenp.frozen/p.frozen = truealso returned false.Test plan
crun b = createBuilding(1337, me.position)thengetElementCollisionsEnabled(b)is true;b.alphais 255;b.alpha = 0returns true and the building goes invisible.crun setElementCollisionsEnabled(b, false)thengetElementCollisionsEnabled(b)is false.getElementCollisionsEnabledmatches the setter;isElementFrozen/setElementFrozenwork.crun p = createProjectile(me, 16, me.position, 1.0) setProjectileCounter(p, 3000)thenp.alpha/p.alpha = 0andp.frozen = truereturn the real values, not false.Checklist