mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-12 02:18:07 +00:00
Merge branch 'main' into fix/cmake-libs-2
This commit is contained in:
@@ -7,10 +7,8 @@
|
||||
void FvBrickPuzzleServer::OnStartup(Entity* self) {
|
||||
const auto myGroup = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner_name"));
|
||||
|
||||
int32_t pipeNum = 0;
|
||||
if (!GeneralUtils::TryParse<int32_t>(myGroup.substr(10, 1), pipeNum)) {
|
||||
return;
|
||||
}
|
||||
const auto pipeNum = GeneralUtils::TryParse<int32_t>(myGroup.substr(10, 1));
|
||||
if (!pipeNum) return;
|
||||
|
||||
if (pipeNum != 1) {
|
||||
self->AddTimer("reset", 30);
|
||||
@@ -20,14 +18,12 @@ void FvBrickPuzzleServer::OnStartup(Entity* self) {
|
||||
void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
|
||||
const auto myGroup = GeneralUtils::UTF16ToWTF8(self->GetVar<std::u16string>(u"spawner_name"));
|
||||
|
||||
int32_t pipeNum = 0;
|
||||
if (!GeneralUtils::TryParse<int32_t>(myGroup.substr(10, 1), pipeNum)) {
|
||||
return;
|
||||
}
|
||||
const auto pipeNum = GeneralUtils::TryParse<int32_t>(myGroup.substr(10, 1));
|
||||
if (!pipeNum) return;
|
||||
|
||||
const auto pipeGroup = myGroup.substr(0, 10);
|
||||
|
||||
const auto nextPipeNum = pipeNum + 1;
|
||||
const auto nextPipeNum = pipeNum.value() + 1;
|
||||
|
||||
const auto samePipeSpawners = Game::zoneManager->GetSpawnersByName(myGroup);
|
||||
|
||||
@@ -37,7 +33,7 @@ void FvBrickPuzzleServer::OnDie(Entity* self, Entity* killer) {
|
||||
samePipeSpawners[0]->Deactivate();
|
||||
}
|
||||
|
||||
if (killer != nullptr && killer->IsPlayer()) {
|
||||
if (killer && killer->IsPlayer()) {
|
||||
const auto nextPipe = pipeGroup + std::to_string(nextPipeNum);
|
||||
|
||||
const auto nextPipeSpawners = Game::zoneManager->GetSpawnersByName(nextPipe);
|
||||
|
@@ -56,7 +56,7 @@ void GfBanana::OnHit(Entity* self, Entity* attacker) {
|
||||
return;
|
||||
}
|
||||
|
||||
bananaEntity->SetPosition(bananaEntity->GetPosition() - NiPoint3::UNIT_Y * 8);
|
||||
bananaEntity->SetPosition(bananaEntity->GetPosition() - NiPoint3Constant::UNIT_Y * 8);
|
||||
|
||||
auto* bananaDestroyable = bananaEntity->GetComponent<DestroyableComponent>();
|
||||
|
||||
|
@@ -2,7 +2,6 @@
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
#include "dZoneManager.h"
|
||||
#include "Player.h"
|
||||
#include "Character.h"
|
||||
#include "ShootingGalleryComponent.h"
|
||||
#include "PossessorComponent.h"
|
||||
|
@@ -1,5 +1,6 @@
|
||||
set(DSCRIPTS_SOURCES_AI_WILD
|
||||
"AllCrateChicken.cpp"
|
||||
"LupGenericInteract.cpp"
|
||||
"WildAmbients.cpp"
|
||||
"WildAmbientCrab.cpp"
|
||||
"WildAndScared.cpp"
|
||||
|
6
dScripts/ai/WILD/LupGenericInteract.cpp
Normal file
6
dScripts/ai/WILD/LupGenericInteract.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "LupGenericInteract.h"
|
||||
#include "GameMessages.h"
|
||||
|
||||
void LupGenericInteract::OnUse(Entity* self, Entity* user) {
|
||||
GameMessages::SendPlayAnimation(self, u"interact");
|
||||
}
|
12
dScripts/ai/WILD/LupGenericInteract.h
Normal file
12
dScripts/ai/WILD/LupGenericInteract.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef __LUCGENERICINTERACT__H__
|
||||
#define __LUCGENERICINTERACT__H__
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class LupGenericInteract : public CppScripts::Script {
|
||||
public:
|
||||
void OnUse(Entity* self, Entity* user) override;
|
||||
};
|
||||
|
||||
#endif //!__LUCGENERICINTERACT__H__
|
||||
|
Reference in New Issue
Block a user