cleanup logs, fix overrides, define LOTs in header

This commit is contained in:
Aaron Kimbre 2022-04-18 21:02:04 -05:00
parent 8fe5c00984
commit f3dd71ccb1
8 changed files with 18 additions and 22 deletions

View File

@ -10,8 +10,6 @@ void HydrantBroken::OnStartup(Entity* self)
const auto bouncers = EntityManager::Instance()->GetEntitiesInGroup(hydrant); const auto bouncers = EntityManager::Instance()->GetEntitiesInGroup(hydrant);
Game::logger->Log("HydrantBroken", "Broken Hydrant spawned (%s)\n", hydrant.c_str());
for (auto* bouncer : bouncers) for (auto* bouncer : bouncers)
{ {
self->SetVar<LWOOBJID>(u"bouncer", bouncer->GetObjectID()); self->SetVar<LWOOBJID>(u"bouncer", bouncer->GetObjectID());

View File

@ -9,14 +9,12 @@ void HydrantSmashable::OnDie(Entity* self, Entity* killer)
LDFBaseData* data = new LDFData<std::string>(u"hydrant", GeneralUtils::UTF16ToWTF8(hydrantName)); LDFBaseData* data = new LDFData<std::string>(u"hydrant", GeneralUtils::UTF16ToWTF8(hydrantName));
EntityInfo info {}; EntityInfo info {};
info.lot = 7328; info.lot = HYDRANT_BROKEN;
info.pos = self->GetPosition(); info.pos = self->GetPosition();
info.rot = self->GetRotation(); info.rot = self->GetRotation();
info.settings = {data}; info.settings = {data};
info.spawnerID = self->GetSpawnerID(); info.spawnerID = self->GetSpawnerID();
Game::logger->Log("HydrantBroken", "Hydrant spawned (%s)\n", data->GetString().c_str());
auto* hydrant = EntityManager::Instance()->CreateEntity(info); auto* hydrant = EntityManager::Instance()->CreateEntity(info);
EntityManager::Instance()->ConstructEntity(hydrant); EntityManager::Instance()->ConstructEntity(hydrant);

View File

@ -4,5 +4,7 @@
class HydrantSmashable : public CppScripts::Script class HydrantSmashable : public CppScripts::Script
{ {
public: public:
void OnDie(Entity* self, Entity* killer) override; void OnDie(Entity* self, Entity* killer) override;
private:
LOT HYDRANT_BROKEN = 7328;
}; };

View File

@ -10,8 +10,6 @@ void RockHydrantBroken::OnStartup(Entity* self)
const auto bouncers = EntityManager::Instance()->GetEntitiesInGroup(hydrant); const auto bouncers = EntityManager::Instance()->GetEntitiesInGroup(hydrant);
Game::logger->Log("RockHydrantBroken", "Broken Rock Hydrant spawned (%s)\n", hydrant.c_str());
for (auto* bouncer : bouncers) for (auto* bouncer : bouncers)
{ {
self->SetVar<LWOOBJID>(u"bouncer", bouncer->GetObjectID()); self->SetVar<LWOOBJID>(u"bouncer", bouncer->GetObjectID());

View File

@ -9,15 +9,13 @@ void RockHydrantSmashable::OnDie(Entity* self, Entity* killer)
LDFBaseData* data = new LDFData<std::string>(u"hydrant", GeneralUtils::UTF16ToWTF8(hydrantName)); LDFBaseData* data = new LDFData<std::string>(u"hydrant", GeneralUtils::UTF16ToWTF8(hydrantName));
EntityInfo info {}; EntityInfo info {};
info.lot = 12293; info.lot = ROCK_HYDRANT_BROKEN;
info.pos = self->GetPosition(); info.pos = self->GetPosition();
info.rot = self->GetRotation(); info.rot = self->GetRotation();
info.settings = {data}; info.settings = {data};
info.spawnerID = self->GetSpawnerID(); info.spawnerID = self->GetSpawnerID();
Game::logger->Log("RockHydrantBroken", "Rock Hydrant spawned (%s)\n", data->GetString().c_str()); auto* hydrant = EntityManager::Instance()->CreateEntity(info);
auto* hydrant = EntityManager::Instance()->CreateEntity(info); EntityManager::Instance()->ConstructEntity(hydrant);
EntityManager::Instance()->ConstructEntity(hydrant);
} }

View File

@ -5,5 +5,7 @@ class RockHydrantSmashable : public CppScripts::Script
{ {
public: public:
void OnDie(Entity* self, Entity* killer); void OnDie(Entity* self, Entity* killer);
private:
LOT ROCK_HYDRANT_BROKEN = 12293;
}; };

View File

@ -7,8 +7,8 @@
class WhFans : public CppScripts::Script class WhFans : public CppScripts::Script
{ {
public: public:
void OnStartup(Entity* self); void OnStartup(Entity* self) override;
void OnDie(Entity* self, Entity* killer); void OnDie(Entity* self, Entity* killer) override;
void OnFireEventServerSide( void OnFireEventServerSide(
Entity *self, Entity *self,
Entity *sender, Entity *sender,
@ -16,7 +16,7 @@ public:
int32_t param1, int32_t param1,
int32_t param2, int32_t param2,
int32_t param3 int32_t param3
); ) override;
private: private:
void ToggleFX(Entity* self, bool hit); void ToggleFX(Entity* self, bool hit);
}; };