Skip to content

Commit

Permalink
Add new multistate methods and registry cleanup for CMangos
Browse files Browse the repository at this point in the history
  • Loading branch information
Foereaper committed Jan 28, 2024
1 parent aa544fb commit 8fef126
Show file tree
Hide file tree
Showing 19 changed files with 484 additions and 119 deletions.
2 changes: 1 addition & 1 deletion CMangos/AuraMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ namespace LuaAura
// Other
{ "Remove", &LuaAura::Remove },

{ NULL, NULL }
{ NULL, NULL, METHOD_REG_NONE }
};
};
#endif
4 changes: 1 addition & 3 deletions CMangos/BattleGroundMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ namespace LuaBattleGround
return 1;
}

#ifndef AZEROTHCORE
/**
* Returns the bracket ID of the specific [BattleGround].
*
Expand All @@ -75,7 +74,6 @@ namespace LuaBattleGround
E->Push(bg->GetBracketId());
return 1;
}
#endif

/**
* Returns the end time of the [BattleGround].
Expand Down Expand Up @@ -249,7 +247,7 @@ namespace LuaBattleGround
{ "GetWinner", &LuaBattleGround::GetWinner },
{ "GetStatus", &LuaBattleGround::GetStatus },

{ NULL, NULL }
{ NULL, NULL, METHOD_REG_NONE }
};
};
#endif
2 changes: 1 addition & 1 deletion CMangos/CorpseMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace LuaCorpse
{ "ResetGhostTime", &LuaCorpse::ResetGhostTime },
{ "SaveToDB", &LuaCorpse::SaveToDB },

{ NULL, NULL }
{ NULL, NULL, METHOD_REG_NONE }
};
};
#endif
36 changes: 21 additions & 15 deletions CMangos/CreatureMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,8 @@ namespace LuaCreature
{ "GetCreatureFamily", &LuaCreature::GetCreatureFamily },
#ifndef CATA
{ "GetShieldBlockValue", &LuaCreature::GetShieldBlockValue },
#else
{ "GetShieldBlockValue", nullptr, METHOD_REG_NONE },
#endif

// Setters
Expand All @@ -1161,6 +1163,8 @@ namespace LuaCreature
{ "SetEquipmentSlots", &LuaCreature::SetEquipmentSlots },
#ifndef CATA
{ "SetDisableReputationGain", &LuaCreature::SetDisableReputationGain },
#else
{ "SetDisableReputationGain", nullptr, METHOD_REG_NONE },
#endif

// Boolean
Expand All @@ -1187,6 +1191,8 @@ namespace LuaCreature
{ "CanFly", &LuaCreature::CanFly },
#ifndef CATA
{ "IsReputationGainDisabled", &LuaCreature::IsReputationGainDisabled },
#else
{ "IsReputationGainDisabled", nullptr, METHOD_REG_NONE },
#endif

// Other
Expand All @@ -1203,21 +1209,21 @@ namespace LuaCreature
{ "UpdateEntry", &LuaCreature::UpdateEntry },

// Not implemented methods
{ "GetWaypointPath", nullptr }, // TC/Acore
{ "GetLootMode", nullptr }, // TC/Acore
{ "SetRegeneratingHealth", nullptr }, // TC/Acore
{ "SetLootMode", nullptr }, // TC/Acore
{ "SetReactState", nullptr }, // TC/Acore
{ "IsDungeonBoss", nullptr }, // TC/Acore
{ "IsTrigger", nullptr }, // TC/Acore
{ "CanStartAttack", nullptr }, // TC/Acore
{ "IsDamageEnoughForLootingAndReward", nullptr }, // TC/Acore
{ "HasLootMode", nullptr }, // TC/Acore
{ "AddLootMode", nullptr }, // TC/Acore
{ "ResetLootMode", nullptr }, // TC/Acore
{ "RemoveLootMode", nullptr }, // TC/Acore

{ NULL, NULL }
{ "GetWaypointPath", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "GetLootMode", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "SetRegeneratingHealth", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "SetLootMode", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "SetReactState", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "IsDungeonBoss", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "IsTrigger", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "CanStartAttack", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "IsDamageEnoughForLootingAndReward", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "HasLootMode", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "AddLootMode", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "ResetLootMode", nullptr, METHOD_REG_NONE }, // TC/Acore
{ "RemoveLootMode", nullptr, METHOD_REG_NONE }, // TC/Acore

{ NULL, NULL, METHOD_REG_NONE }
};
};
#endif
4 changes: 2 additions & 2 deletions CMangos/ElunaQueryMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ namespace LuaQuery

const char* str = row[i].GetString();
if (row[i].IsNULL() || !str)
E->Push(E->L);
E->Push();
else
{
// MYSQL_TYPE_LONGLONG Interpreted as string for lua
Expand Down Expand Up @@ -335,7 +335,7 @@ namespace LuaQuery
{ "NextRow", &LuaQuery::NextRow },
{ "IsNull", &LuaQuery::IsNull },

{ NULL, NULL }
{ NULL, NULL, METHOD_REG_NONE }
};
};
#undef RESULT
Expand Down
4 changes: 2 additions & 2 deletions CMangos/GameObjectMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ namespace LuaGameObject
{ "SaveToDB", &LuaGameObject::SaveToDB },

// Not implemented methods
{ "IsDestructible", nullptr }, // Not implemented
{ "IsDestructible", nullptr, METHOD_REG_NONE }, // Not implemented

{ NULL, NULL }
{ NULL, NULL, METHOD_REG_NONE }
};
};
#endif
Loading

0 comments on commit 8fef126

Please sign in to comment.