Skip to content

Fix #5222, #5223, #5224: Wire missing element getter/setter types - #5227

Open
x6c85 wants to merge 1 commit into
multitheftauto:masterfrom
x6c85:fix/5222-5224-element-getters-setters
Open

Fix #5222, #5223, #5224: Wire missing element getter/setter types#5227
x6c85 wants to merge 1 commit into
multitheftauto:masterfrom
x6c85:fix/5222-5224-element-getters-setters

Conversation

@x6c85

@x6c85 x6c85 commented Aug 18, 2026

Copy link
Copy Markdown

Summary

getElementAlpha / setElementAlpha, isElementFrozen / setElementFrozen and getElementCollisionsEnabled were missing building, weapon and projectile in their type switches, so they returned false even when the matching setter already worked.

  • Buildings: alpha and collisions getter
  • Weapons: collisions getter and frozen get/set (CClientWeapon already inherits object alpha)
  • Projectiles: alpha and frozen get/set

Motivation

Fixes #5222, #5223 and #5224. crun b = createBuilding(1337, me.position) then b.alpha / getElementCollisionsEnabled(b) returned false. createProjectile then p.frozen / p.frozen = true also returned false.

Test plan

  1. crun b = createBuilding(1337, me.position) then getElementCollisionsEnabled(b) is true; b.alpha is 255; b.alpha = 0 returns true and the building goes invisible.
  2. crun setElementCollisionsEnabled(b, false) then getElementCollisionsEnabled(b) is false.
  3. Create a custom weapon: getElementCollisionsEnabled matches the setter; isElementFrozen / setElementFrozen work.
  4. crun p = createProjectile(me, 16, me.position, 1.0) setProjectileCounter(p, 3000) then p.alpha / p.alpha = 0 and p.frozen = true return the real values, not false.
  5. Existing ped/vehicle/object alpha, frozen and collisions unchanged.

Checklist

  • Your code should follow the coding guidelines.
  • Smaller pull requests are easier to review. If your pull request is beefy, your pull request should be reviewable commit-by-commit.

…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.
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.

getElementAlpha/setElementAlpha return false for building and projectile elements.

1 participant