Files
TeslaRel410/restoration/source410/BT/EMITTER.CPP
T
CydandClaude Fable 5 812ca99652 BT410: reconstructed source BOOTS into the live game loop (zero Fail)
Phase-5.1 crash solved + two BTPlayer bricks reconstructed. The tree now
builds AND boots end-to-end with no staged Fail() reached, into the running
per-frame game loop.

- EMITTER.CPP: define Emitter::AttributePointers[]/AttributeIndex (ChargeLevel,
  chained to Subsystem::AttributeIndex) and point Emitter::DefaultData at it.
  EMITTER.HPP declared the index but the .cpp never defined it, so the surviving
  PPC.CPP (PPC::DefaultData binds inherited Emitter::AttributeIndex) and
  GAUSS.CPP (chains it) captured a NULL activeAttributeIndex -> GetAttributePointer
  faulted on the first PPC (roster slot 22). Fix clears all 33 roster slots and
  the control-mapping binding block.

- BTPLAYER.CPP InitializePlayerLink: real body -- dispatch PlayerLinkMessage
  (our EntityID) to playerVehicle + replicants (mirrors engine
  CameraDirector::CreateCameraShip). No staging.

- BTPLAYER.CPP VehicleDeadMessageHandler: non-death flavours (-2 drop-zone probe,
  >=0 respawn re-post) delegate to the authentic Player base handler; only the
  -1 death cycle stays staged (needs mech4 + scoring roles).

Verified: 516-line smoke run, zero Fail/Exception/abort; boot reaches
LBE4ControlsManager::Execute per-frame, waiting only on absent RIO hardware.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 11:51:04 -05:00

125 lines
3.4 KiB
C++

//===========================================================================//
// File: emitter.cpp //
// Project: BattleTech Brick: Mech weapons //
// Contents: Emitter -- the energy-weapon (beam) base //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#include <bt.hpp>
#pragma hdrstop
#if !defined(EMITTER_HPP)
# include <emitter.hpp>
#endif
#if !defined(MECH_HPP)
# include <mech.hpp>
#endif
Derivation
Emitter::ClassDerivations(
MechWeapon::ClassDerivations,
"Emitter"
);
//
//#############################################################################
// Attribute Support. Emitter publishes the beam charge level (ChargeLevel):
// the HUD weapon-charge gauge binds to it, and -- load-bearing -- GaussRifle's
// AttributeIndex chains THIS index (GAUSS.CPP), and PPC::DefaultData binds it
// via the inherited PPC::AttributeIndex. It MUST be a real defined index
// chained to Subsystem::AttributeIndex, not the bare base (a declared-but-
// undefined Emitter::AttributeIndex leaves activeAttributeIndex NULL and
// faults the first GetAttributePointer on any PPC/Gauss).
//#############################################################################
//
const Emitter::IndexEntry
Emitter::AttributePointers[]=
{
ATTRIBUTE_ENTRY(Emitter, ChargeLevel, chargeLevel)
};
Emitter::AttributeIndexSet
Emitter::AttributeIndex(
ELEMENTS(Emitter::AttributePointers),
Emitter::AttributePointers,
Subsystem::AttributeIndex
);
Emitter::SharedData
Emitter::DefaultData(
Emitter::ClassDerivations,
Subsystem::MessageHandlers,
Emitter::AttributeIndex,
Subsystem::StateCount
);
Emitter::Emitter(
Mech *owner,
int subsystem_ID,
SubsystemResource *subsystem_resource,
SharedData &shared_data
):
MechWeapon(owner, subsystem_ID, subsystem_resource, shared_data)
{
Check(owner);
Check_Pointer(subsystem_resource);
chargeLevel = 0.0f;
dischargeTime = subsystem_resource->dischargeTime;
Check_Fpu();
}
Emitter::~Emitter()
{
}
Logical
Emitter::TestClass(Mech &)
{
return True;
}
Logical
Emitter::TestInstance() const
{
return IsDerivedFrom(ClassDerivations);
}
//
//#############################################################################
// FireWeapon The energy-beam discharge. Not yet reconstructed (the fire path
// is exercised in combat, past the current ctor frontier).
//#############################################################################
//
void
Emitter::FireWeapon()
{
Fail("Emitter::FireWeapon -- emitter.cpp not yet reconstructed");
}
//
//#############################################################################
// CreateStreamedSubsystem Model-load-time construction. Not yet reconstructed.
//#############################################################################
//
int
Emitter::CreateStreamedSubsystem(
ResourceFile *,
NotationFile *,
const char *,
const char *,
SubsystemResource *,
NotationFile *,
const ResourceDirectories *,
int
)
{
Fail("Emitter::CreateStreamedSubsystem -- emitter.cpp not yet reconstructed");
return 0;
}