Skip to content

Make more widespread use of D20CAF type rather than just integers#938

Draft
dolio wants to merge 1 commit intoGrognardsFromHell:masterfrom
dolio:cleanup/d20caf
Draft

Make more widespread use of D20CAF type rather than just integers#938
dolio wants to merge 1 commit intoGrognardsFromHell:masterfrom
dolio:cleanup/d20caf

Conversation

@dolio
Copy link
Copy Markdown
Contributor

@dolio dolio commented Jan 21, 2026

This PR doesn't change any logic. It just tries to make using the D20CAF type better without circumventing type checking.

  • It makes D20Actn have a D20CAF field for flags, rather than just an integer.
  • It adds bitwise operations for D20CAF that maintain the type instead of auto-converting to uint32_t.
  • It removes a bunch of casts that are unnecessary in light of the above two changes.

For python, I elected to keep things as integers, and changed the flags field to use def_property to do the conversion. This is because python enums don't work as well with flag types, at least in python 2.

The motivation for this was annoyance when porting more grenade functions, having to cast things back to D20CAF and whatnot.

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.

1 participant