mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 19:03:43 +00:00
The dropship computer's OnDie activated the "next" spawner network (pipe number + 1) when a player smashed it and only fell back to the first network otherwise. The computer has no next network, so once a player smashed it (easiest with area attacks like the Doom Hammer) it never came back. The live script (L_DROPSHIP_COMPUTER.lua, shipped in the client's server scripts) always resets its own network and activates the first one, which is what it does now. OnUse also dereferenced GetMission(979) without a null check, crashing the world when a player without that mission used the built computer. It now matches the live script: only players with the mission active get the Nexus Talon data card, once. SsModularBuildServer had the same unchecked GetMission and now checks the mission state. Fixes #596 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
16 lines
561 B
C++
16 lines
561 B
C++
#include "SsModularBuildServer.h"
|
|
#include "MissionComponent.h"
|
|
#include "eMissionState.h"
|
|
|
|
void SsModularBuildServer::OnModularBuildExit(Entity* self, Entity* player, bool bCompleted, std::vector<LOT> modules) {
|
|
int missionNum = 1732;
|
|
|
|
if (bCompleted) {
|
|
auto* const mission = player->GetComponent<MissionComponent>();
|
|
// The player may never have had this mission, so check the state instead of the mission itself.
|
|
if (mission && mission->GetMissionState(missionNum) == eMissionState::ACTIVE) {
|
|
mission->ForceProgress(missionNum, 2478, 1);
|
|
}
|
|
}
|
|
}
|