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

Make some fields on objects/map objects immutable #164

Merged
merged 13 commits into from
Mar 2, 2021

Conversation

Ruin0x11
Copy link
Owner

@Ruin0x11 Ruin0x11 commented Mar 2, 2021

Purpose of this PR

  • Bug fix
  • Enhancement
  • New feature

Related issues

#135.

Description

Makes a bunch of fields that shouldn't be modifiable on objects/map objects immutable by hiding them in the metatable.

This changes a bit in how serialization works, so I expect some amount of regressions, but there are a lot of tests to match.

Otherwise LOVE will die when the error gets concatted later.
LÖVE doesn't like absolute paths, but we don't emulate this behavior
headlessly, so it was missed.
This is somewhat more complicated than the rest, so I'm expecting
regressions.

location gets stored on the metatable. Now that the metatable is keeping
individual state per object, it no longer makes sense to share them
between cloned objects, so a bit of code was added to
MapObject.clone() to account for that.
@Ruin0x11 Ruin0x11 added enhancement New feature or request design Concerns the architecture of the engine labels Mar 2, 2021
@Ruin0x11 Ruin0x11 force-pushed the feature/change-object-prototype branch from d821958 to 37d9948 Compare March 2, 2021 21:42
@Ruin0x11 Ruin0x11 merged commit 777c16d into develop Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Concerns the architecture of the engine enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant