diff --git a/Source/Contents/SpriteRidingPolicy.cpp b/Source/Contents/SpriteRidingPolicy.cpp new file mode 100644 index 00000000..1b33c229 --- /dev/null +++ b/Source/Contents/SpriteRidingPolicy.cpp @@ -0,0 +1,25 @@ +#include "Contents/SpriteRidingPolicy.h" +#include "Client/Session.h" +#include "Contents/Jobs/JobNames.h" +#include "Script/LuaScript.h" + +// OFFSET: 0x00DAB2C0 +// FUNCTION: fn_22583 +bool IsIgnoredRidingState(int id, int job, int effectState, bool force) { + if (!force && job == JobNames::BaseJob(job)) { + return false; + } + + switch (effectState) { + case 0: + case 8: + case 16: + case 64: { + bool ignored = false; + g_session.m_hotkeyScript->CallTable("TB_Layer_Priority", "IsIgnoredRidingState", "d>b", id, &ignored); + return ignored; + } + } + + return false; +} diff --git a/Source/Contents/SpriteRidingPolicy.h b/Source/Contents/SpriteRidingPolicy.h new file mode 100644 index 00000000..1a86019c --- /dev/null +++ b/Source/Contents/SpriteRidingPolicy.h @@ -0,0 +1,6 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_SPRITERIDINGPOLICY_H +#define RAGNAROK_SOURCE_CONTENTS_SPRITERIDINGPOLICY_H + +bool IsIgnoredRidingState(int id, int job, int effectState, bool force); + +#endif diff --git a/data/compile.json b/data/compile.json index 3c3719bf..de549143 100644 --- a/data/compile.json +++ b/data/compile.json @@ -409,6 +409,7 @@ "Source/Contents/Sound/SoundConfiguration.cpp": 4, "Source/Contents/Sound/SoundMaker.cpp": 4, "Source/Contents/Sound/SoundMgr.cpp": 4, + "Source/Contents/SpriteRidingPolicy.cpp": 4, "Source/Contents/Store/MCStoreInfoBackup.cpp": 4, "Source/Contents/Store/MCStoreInfoBackupAsyncWork.cpp": 4, "Source/Contents/Store/StoreBackupData.cpp": 4,