-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Miscellaneous trait look-up reductions #19166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mods won't be able to add multiple Mobile traits to an actor? In the past it would cause an exception during trait lookup. Now it would cause OccupiesSpace to be used?
b1bec67
to
8ece2fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me, just had a couple of small style nits.
For Attack*.CanAttack(). Allows us to drop the additional check for armaments with ammo.
8ece2fe
to
3fceefb
Compare
Updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes lgtm but untested
Some more trait look-up reductions in places that might not get called that often, but potentially several times at once.
I was too lazy to measure the performance impact (unlikely to be noteworthy, anyway), but those felt simple enough to pass as "can't hurt and might add up, without regressing or over-complicating code".