mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
Merge DarkflameServer
This commit is contained in:
@@ -40,13 +40,13 @@ std::string CDBehaviorParameterTable::GetName(void) const {
|
||||
return "BehaviorParameter";
|
||||
}
|
||||
|
||||
float CDBehaviorParameterTable::GetEntry(const uint32_t behaviorID, const std::string& name)
|
||||
float CDBehaviorParameterTable::GetEntry(const uint32_t behaviorID, const std::string& name, const float defaultValue)
|
||||
{
|
||||
size_t hash = 0;
|
||||
GeneralUtils::hash_combine(hash, behaviorID);
|
||||
GeneralUtils::hash_combine(hash, name);
|
||||
|
||||
// Search for specific perameter
|
||||
// Search for specific parameter
|
||||
const auto& it = m_Entries.find(hash);
|
||||
if (it != m_Entries.end()) {
|
||||
return it->second;
|
||||
@@ -55,7 +55,7 @@ float CDBehaviorParameterTable::GetEntry(const uint32_t behaviorID, const std::s
|
||||
// Check if this behavior has already been checked
|
||||
const auto& itChecked = m_Entries.find(behaviorID);
|
||||
if (itChecked != m_Entries.end()) {
|
||||
return itChecked->second;
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
#ifndef CDCLIENT_CACHE_ALL
|
||||
@@ -86,5 +86,5 @@ float CDBehaviorParameterTable::GetEntry(const uint32_t behaviorID, const std::s
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
return defaultValue;
|
||||
}
|
||||
|
@@ -35,5 +35,5 @@ public:
|
||||
*/
|
||||
std::string GetName(void) const override;
|
||||
|
||||
float GetEntry(const uint32_t behaviorID, const std::string& name);
|
||||
float GetEntry(const uint32_t behaviorID, const std::string& name, const float defaultValue = 0);
|
||||
};
|
||||
|
@@ -58,7 +58,7 @@ CDMissionsTable::CDMissionsTable(void) {
|
||||
entry.reward_item2_repeatable = tableData.getIntField(32, -1);
|
||||
entry.reward_item2_repeat_count = tableData.getIntField(33, -1);
|
||||
entry.reward_item3_repeatable = tableData.getIntField(34, -1);
|
||||
entry.reward_item3_repeat_count = tableData.getIntField(34, -1);
|
||||
entry.reward_item3_repeat_count = tableData.getIntField(35, -1);
|
||||
entry.reward_item4_repeatable = tableData.getIntField(36, -1);
|
||||
entry.reward_item4_repeat_count = tableData.getIntField(37, -1);
|
||||
entry.time_limit = tableData.getIntField(38, -1);
|
||||
|
Reference in New Issue
Block a user