Merge main into property-entrance-rewrite

This commit is contained in:
Jettford
2023-10-28 01:09:03 +01:00
parent 758bf8becf
commit 6df16ab406
220 changed files with 1451 additions and 1274 deletions

View File

@@ -2,7 +2,7 @@
#include <BitStream.h>
#include "tinyxml2.h"
#include "Game.h"
#include "dLogger.h"
#include "Logger.h"
#include "GeneralUtils.h"
#include "dServer.h"
#include "dZoneManager.h"
@@ -16,6 +16,7 @@
#include "Amf3.h"
#include "eGameMasterLevel.h"
#include "eGameActivity.h"
#include <ctime>
CharacterComponent::CharacterComponent(Entity* parent, Character* character) : Component(parent) {
m_Character = character;
@@ -178,7 +179,7 @@ void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("CharacterComponent", "Failed to find char tag while loading XML!");
LOG("Failed to find char tag while loading XML!");
return;
}
if (character->QueryAttribute("rpt", &m_Reputation) == tinyxml2::XML_NO_ATTRIBUTE) {
@@ -283,7 +284,7 @@ void CharacterComponent::LoadFromXml(tinyxml2::XMLDocument* doc) {
void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* minifig = doc->FirstChildElement("obj")->FirstChildElement("mf");
if (!minifig) {
Game::logger->Log("CharacterComponent", "Failed to find mf tag while updating XML!");
LOG("Failed to find mf tag while updating XML!");
return;
}
@@ -303,7 +304,7 @@ void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
tinyxml2::XMLElement* character = doc->FirstChildElement("obj")->FirstChildElement("char");
if (!character) {
Game::logger->Log("CharacterComponent", "Failed to find char tag while updating XML!");
LOG("Failed to find char tag while updating XML!");
return;
}
@@ -351,7 +352,7 @@ void CharacterComponent::UpdateXml(tinyxml2::XMLDocument* doc) {
//
auto newUpdateTimestamp = std::time(nullptr);
Game::logger->Log("TotalTimePlayed", "Time since last save: %d", newUpdateTimestamp - m_LastUpdateTimestamp);
LOG("Time since last save: %d", newUpdateTimestamp - m_LastUpdateTimestamp);
m_TotalTimePlayed += newUpdateTimestamp - m_LastUpdateTimestamp;
character->SetAttribute("time", m_TotalTimePlayed);
@@ -381,7 +382,7 @@ Item* CharacterComponent::GetRocket(Entity* player) {
}
if (!rocket) {
Game::logger->Log("CharacterComponent", "Unable to find rocket to equip!");
LOG("Unable to find rocket to equip!");
return rocket;
}
return rocket;