mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-16 19:54:23 +00:00
Compare commits
1 Commits
canary
...
shrink-ran
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
855864c536 |
@@ -8,6 +8,8 @@ public:
|
||||
|
||||
float m_npcSkillTime;
|
||||
|
||||
float m_maxRange{};
|
||||
|
||||
/*
|
||||
* Inherited
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,7 @@ void VerifyBehavior::Calculate(BehaviorContext* context, RakNet::BitStream& bitS
|
||||
|
||||
const auto distance = Vector3::DistanceSquared(self->GetPosition(), entity->GetPosition());
|
||||
|
||||
if (distance > this->m_range * this->m_range) {
|
||||
if (distance > this->m_range) {
|
||||
success = false;
|
||||
}
|
||||
} else if (this->m_blockCheck) {
|
||||
@@ -57,4 +57,5 @@ void VerifyBehavior::Load() {
|
||||
this->m_action = GetAction("action");
|
||||
|
||||
this->m_range = GetFloat("range");
|
||||
this->m_range = this->m_range * this->m_range * 0.9f; // Range checks are slightly smaller than the actual range to account for client/server discrepancies
|
||||
}
|
||||
|
||||
@@ -962,12 +962,5 @@ namespace GameMessages {
|
||||
|
||||
LWOOBJID childID{};
|
||||
};
|
||||
|
||||
struct ObjectLoaded : public GameMsg {
|
||||
ObjectLoaded() : GameMsg(MessageType::Game::OBJECT_LOADED) {}
|
||||
|
||||
LWOOBJID objectID{};
|
||||
LOT lot{};
|
||||
};
|
||||
};
|
||||
#endif // GAMEMESSAGES_H
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
set(DSCRIPTS_SOURCES_02_SERVER_DLU
|
||||
"DLUVanityTeleportingObject.cpp"
|
||||
"RegisterWithZoneControl.cpp"
|
||||
PARENT_SCOPE)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#include "RegisterWithZoneControl.h"
|
||||
|
||||
#include "Entity.h"
|
||||
#include "EntityManager.h"
|
||||
#include "GameMessages.h"
|
||||
|
||||
void RegisterWithZoneControl::OnStartup(Entity* self) {
|
||||
GameMessages::ObjectLoaded objLoaded;
|
||||
objLoaded.objectID = self->GetObjectID();
|
||||
objLoaded.lot = self->GetLOT();
|
||||
objLoaded.Send(Game::entityManager->GetZoneControlEntity()->GetObjectID());
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
// Darkflame Universe
|
||||
// Copyright 2026
|
||||
|
||||
#ifndef REGISTERWITHZONECONTROL_H
|
||||
#define REGISTERWITHZONECONTROL_H
|
||||
|
||||
#include "CppScripts.h"
|
||||
|
||||
class RegisterWithZoneControl : public CppScripts::Script {
|
||||
public:
|
||||
void OnStartup(Entity* self) override;
|
||||
};
|
||||
|
||||
#endif //!REGISTERWITHZONECONTROL_H
|
||||
@@ -13,6 +13,7 @@ void ResetMissions(Entity& user) {
|
||||
}
|
||||
|
||||
void OldManNPC::OnUse(Entity* self, Entity* user) {
|
||||
LOG("");
|
||||
const auto* const missionComponent = user->GetComponent<MissionComponent>();
|
||||
if (!missionComponent) return;
|
||||
|
||||
@@ -23,6 +24,7 @@ void OldManNPC::OnUse(Entity* self, Entity* user) {
|
||||
}
|
||||
|
||||
const auto missionState = mission->GetMissionState();
|
||||
LOG("mission state %i", missionState);
|
||||
if (missionState == eMissionState::AVAILABLE || missionState == eMissionState::COMPLETE_AVAILABLE) {
|
||||
ResetMissions(*user);
|
||||
}
|
||||
|
||||
@@ -339,8 +339,6 @@
|
||||
#include "ImaginationBackPack.h"
|
||||
#include "NsWinterRaceServer.h"
|
||||
|
||||
#include "RegisterWithZoneControl.h"
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <functional>
|
||||
@@ -665,7 +663,6 @@ namespace {
|
||||
|
||||
//WBL
|
||||
{"scripts\\zone\\LUPs\\WBL_generic_zone.lua", []() {return new WblGenericZone();}},
|
||||
{"scripts\\zone\\LUPs\\Moonbase Intro\\MOONBASE-INTRO_INTRO_CINEMATIC.lua", []() {return new WblGenericZone();}},
|
||||
|
||||
//Alpha
|
||||
{"scripts\\ai\\FV\\L_TRIGGER_GAS.lua", []() {return new TriggerGas();}},
|
||||
@@ -711,8 +708,7 @@ namespace {
|
||||
{"scripts\\ai\\RACING\\OBJECTS\\VEHICLE_DEATH_TRIGGER_WATER_SERVER.lua", []() {return new VehicleDeathTriggerWaterServer();}},
|
||||
{"scripts\\equipmenttriggers\\L_TRIAL_FACTION_ARMOR_SERVER.lua", []() {return new TrialFactionArmorServer();}},
|
||||
{"scripts\\equipmenttriggers\\ImaginationBackPack.lua", []() {return new ImaginationBackPack();}},
|
||||
{"scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON_INSTANCE_ACTOR.lua", [](){return new RegisterWithZoneControl();}},
|
||||
{"scripts\\ai\\MINIGAME\\SG_GF\\SERVER\\SG_CANNON_INSTANCE_EFFECT.lua", [](){return new RegisterWithZoneControl();}},
|
||||
|
||||
};
|
||||
|
||||
std::set<std::string> g_ExcludedScripts = {
|
||||
@@ -736,11 +732,6 @@ namespace {
|
||||
"scripts\\zone\\LUPs\\RobotCity Intro\\WBL_RCIntro_InfectedCitizen.lua",
|
||||
"scripts\\ai\\MINIGAME\\SIEGE\\OBJECTS\\ATTACKER_BOUNCER_SERVER.lua",
|
||||
"scripts\\ai\\AG\\L_AG_ZONE_PLAYER.lua",
|
||||
"scripts\\ai\\GENERAL\\L_NPC_GENERIC_MOVEMENT.lua", // Really old alpha script
|
||||
"scripts\\zone\\LUPs\\DeepFreeze Intro\\WBL_Enemy_Beaver.lua", // Really old alpha script
|
||||
"scripts\\ai\\GENERAL\\L_NPC_GENERIC_WANDER_SMALL.lua", // Really old alpha script
|
||||
"scripts\\ai\\NP\\L_NPC_NP_OLD_MAN_SHERLAND.lua", // This NPC doesn't even exist in modern crux, the only place this is used...
|
||||
"scripts\\02_server\\Map\\General\\L_SIMPLE_MOVER_SWITCH.lua", // This platform does not exist even when moved manually on a client
|
||||
};
|
||||
};
|
||||
|
||||
@@ -754,8 +745,7 @@ CppScripts::Script* const CppScripts::GetScript(Entity* parent, const std::strin
|
||||
Script* script = itrTernary != scriptLoader.cend() ? itrTernary->second() : &InvalidToReturn;
|
||||
|
||||
if (script == &InvalidToReturn && !scriptName.empty() && !g_ExcludedScripts.contains(scriptName)) {
|
||||
const auto [x, y, z] = parent->GetPosition();
|
||||
LOG_DEBUG("LOT %i at %f %f %f attempted to load CppScript for '%s', but returned InvalidScript.", parent->GetLOT(), x, y, z, scriptName.c_str());
|
||||
LOG_DEBUG("LOT %i attempted to load CppScript for '%s', but returned InvalidScript.", parent->GetLOT(), scriptName.c_str());
|
||||
}
|
||||
|
||||
g_Scripts[scriptName] = script;
|
||||
|
||||
Reference in New Issue
Block a user