Closed alexeevdv closed 2 years ago
OBJECT_TYPE macro is common for all kind if IDs. FID and PID share same "object type" marker. And SID has script type at the same position. We can make generic type extractor like GET_TYPE(id) or split them to FID_TYPE, PID_TYPE and SID_TYPE
I would go with separate extractors. Even though object type is indeed stored in the upper byte on both fid and pid, they are representing entirely different things. FID_TYPE
and PID_TYPE
will make it obvious if you're dealing with fid or pid respectively, make things searchable, and eventually it will be easier to refactor for community edition if needed.
Thanks for you recent PRs. On this one. I really think
OBJECT_TYPE
name is too ambiguous. There is a mention ofproto_type
in debug prints, implying there was a separate set of macros to obtain fields from fids and pids. Something likefidGetObjectType
(as a rename forOBJECT_TYPE
),fidGetFrmId
,fidGetAnimation
,fidGetWeaponAnimationCode
will definitely bring more clarity to the codebase.