Renamed some object flags

This commit is contained in:
NovaRain
2023-03-05 10:21:17 +08:00
parent 5e3e37f74c
commit 6903d59e6d
4 changed files with 16 additions and 9 deletions
+11 -4
View File
@@ -2,8 +2,10 @@
#ifndef DEFINE_EXTRA_H
#define DEFINE_EXTRA_H
#define PID_PLAYER (16777216)
/* Combat Flags */
#define DAM_PRESERVE_FLAGS 0x80000000 // keep the existing result flags when setting new flags in attack_complex (for sfall)
#define DAM_PRESERVE_FLAGS (0x80000000) // keep the existing result flags when setting new flags in attack_complex (for sfall)
#define BODY_HIT_HEAD (0)
#define BODY_HIT_LEFT_ARM (1)
@@ -67,12 +69,12 @@
#define ATKMODE_SEC_FLAME 128 // 0x00000080
/* Object flags for get/set_flags */
#define FLAG_MOUSE_3D (0x1)
#define FLAG_WALKTHRU (0x4)
#define FLAG_HIDDEN (0x1)
#define FLAG_NOSAVE (0x4)
#define FLAG_FLAT (0x8)
#define FLAG_NOBLOCK (0x10)
#define FLAG_LIGHTING (0x20)
#define FLAG_TEMP (0x400)
#define FLAG_NOREMOVE (0x400)
#define FLAG_MULTIHEX (0x800)
#define FLAG_NOHIGHLIGHT (0x1000)
#define FLAG_USED (0x2000)
@@ -105,6 +107,9 @@
#define CFLG_NOKNOCKBACK 16384 // 0x00004000 - Knock (cannot be knocked back)
#define CFLG_NOKNOCKDOWN CFLG_NOKNOCKBACK // obsolete
/* Door flags */
#define FLAG_WALKTHRU (0x4)
/* Window flags */
#define WIN_FLAG_DONTMOVE (0x2) // does not move the window to the foreground when clicking on the window
#define WIN_FLAG_MOVEONTOP (0x4) // places the window on top of other windows
@@ -351,6 +356,8 @@
#define OBJ_DATA_MISC_FLAGS (0x38)
#define OBJ_DATA_PID (0x64)
#define OBJ_DATA_CID (0x68) // combat ID, used by critters in savegame (don't change while in combat)
#define OBJ_DATA_LIGHT_DISTANCE (0x6C)
#define OBJ_DATA_LIGHT_INTENSITY (0x70)
#define OBJ_DATA_SID (0x78) // script ID
#define OBJ_DATA_SCRIPT_INDEX (0x80) // script index number in scripts.lst
// items
+3 -3
View File
@@ -244,12 +244,12 @@ enum Material : long
namespace ObjectFlag {
enum ObjectFlag : unsigned long {
Mouse_3d = 0x00000001,
WalkThru = 0x00000004,
Hidden = 0x00000001,
NoSave = 0x00000004, // WalkThru flag for doors
Flat = 0x00000008,
NoBlock = 0x00000010,
Lighting = 0x00000020,
Temp = 0x00000400, // ???
NoRemove = 0x00000400,
MultiHex = 0x00000800,
NoHighlight = 0x00001000,
Used = 0x00002000, // set if there was/is any event for the object
+1 -1
View File
@@ -1144,7 +1144,7 @@ static void __declspec(naked) obj_load_func_hack() {
static const DWORD obj_load_func_Ret = 0x488F14;
using fo::InCombat;
__asm {
test word ptr [eax + flags], Temp; // engine code
test word ptr [eax + flags], NoRemove; // engine code
jz fix;
retn;
fix:
+1 -1
View File
@@ -339,7 +339,7 @@ void op_get_party_members(OpcodeContext& ctx) {
DWORD arrayId = CreateTempArray(0, 4);
for (int i = 0; i < actualCount; i++) {
fo::GameObject* obj = (*fo::ptr::partyMemberList)[i].object;
if (includeHidden || (obj->IsCritter() && !fo::func::critter_is_dead(obj) && !(obj->flags & fo::ObjectFlag::Mouse_3d))) {
if (includeHidden || (obj->IsCritter() && !fo::func::critter_is_dead(obj) && !(obj->flags & fo::ObjectFlag::Hidden))) {
arrays[arrayId].push_back((long)obj);
}
}