Skip to content

Commit

Permalink
Merge branch 'main' into dudantas/fix-hireling-stash-and-bank
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas authored Nov 22, 2023
2 parents d7351e1 + 3283a23 commit cf4bdac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/network/protocol/protocolgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6899,7 +6899,10 @@ void ProtocolGame::sendPreyData(const std::unique_ptr<PreySlot> &slot) {
}

if (oldProtocol) {
msg.add<uint16_t>(static_cast<uint16_t>(std::max<uint32_t>(std::max<uint32_t>(static_cast<uint32_t>(((slot->freeRerollTimeStamp - OTSYS_TIME()) / 1000)), 0), 0)));
auto currentTime = OTSYS_TIME();
auto timeDiffMs = (slot->freeRerollTimeStamp > currentTime) ? (slot->freeRerollTimeStamp - currentTime) : 0;
auto timeDiffMinutes = timeDiffMs / 60000;
msg.add<uint16_t>(timeDiffMinutes ? timeDiffMinutes : 0);
} else {
msg.add<uint32_t>(std::max<uint32_t>(static_cast<uint32_t>(((slot->freeRerollTimeStamp - OTSYS_TIME()) / 1000)), 0));
msg.addByte(static_cast<uint8_t>(slot->option));
Expand Down

0 comments on commit cf4bdac

Please sign in to comment.