mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 14:44:55 +02:00
finish quest log and fix bug that expiring storage does not fit in int32 so changed to store time in minutes instead of ms
This commit is contained in:
@@ -973,7 +973,7 @@ void BehaviourDatabase::checkAction(const NpcBehaviourAction* action, Player* pl
|
||||
case BEHAVIOUR_TYPE_EXPIRINGQUESTVALUE: {
|
||||
int32_t questNumber = evaluate(action->expression, player, message);
|
||||
int32_t ticks = evaluate(action->expression2, player, message);
|
||||
player->addStorageValue(questNumber, OTSYS_TIME() + ticks);
|
||||
player->addStorageValue(questNumber, OTSYS_TIME_MINUTES() + (ticks / 60 / 1000));
|
||||
break;
|
||||
}
|
||||
case BEHAVIOUR_TYPE_ADDOUTFITADDON: {
|
||||
@@ -1201,7 +1201,7 @@ int32_t BehaviourDatabase::evaluate(NpcBehaviourNode* node, Player* player, cons
|
||||
int32_t questNumber = evaluate(node->left, player, message);
|
||||
int32_t questValue;
|
||||
player->getStorageValue(questNumber, questValue);
|
||||
return questValue - OTSYS_TIME();
|
||||
return questValue - OTSYS_TIME_MINUTES();
|
||||
}
|
||||
case BEHAVIOUR_TYPE_MESSAGE_COUNT: {
|
||||
int32_t value = searchDigit(message);
|
||||
|
@@ -108,4 +108,9 @@ inline int64_t OTSYS_TIME()
|
||||
return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
|
||||
}
|
||||
|
||||
inline int32_t OTSYS_TIME_MINUTES()
|
||||
{
|
||||
return std::chrono::duration_cast<std::chrono::minutes>(std::chrono::system_clock::now().time_since_epoch()).count();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user