gauge wave P2b: build the Comm KILLS/DEATHS pilot roster (PilotList)
PilotList (keyword "pilotList") was PROSE-ONLY, so the Comm surface showed only
the baked btcomm.pcx labels. Reconstructed all 7 functions from part_014.c:
3156-3434 (Make/ctor/dtor/BecameActive/TestInstance/Execute/DrawMechIcon), with
the 8x(x,y,layoutMode) layout table DAT_0051af88 PE-parsed exact from BTL4OPT.EXE.
Draws ONE roster slot/frame (round-robin) from the viewpoint mech's cockpit-mapper
pilot roster.
- Roster FEED: new BTResolveRosterPilot(slot) bridge in mechmppr.cpp (a complete-Mech
TU) resolves the viewpoint mech's ControlsMapper (subsystemArray[0]) -> GetPilot;
btl4gau3.cpp reads the returned pilot at raw BTPlayer offsets. The mapper's
FillPilotArray already fills the roster (pilotArray[0]=GetMissionPlayer,
[1..]=FindGroup("Players")).
- KILLS = killCount@0x27c (real; ScoreMessageHandler increments it in combat).
- DEATHS: the binary reads pad_0x280 which has NO writer anywhere (a shipped dead
field -> perpetual 0). FIX per "if it doesn't work, fix it": read the real
deaths counter Player::deathCount@0x200 (VehicleDeadMessageHandler increments it)
so DEATHS is meaningful in MP.
- DrawMechIcon: App+0xC8 name-bitmap cache is unwired (same deferral PlayerStatus
uses) -> LookupPlayerNameBitmap returns NULL -> the tinted name box (never an AV).
Dropped the bogus x,y from the header ctor (positions come from DAT_0051af88).
/FORCE-safe (all vtable slots real; link log clean, no unresolved PilotList/
BTResolveRosterPilot). Verified DBASE+dev gauges: the Comm surface now renders the
live local pilot row (KILLS 0 DEATHS 0 + name box; 0/0 authentic in solo -- the
combat scoring feed that moves them is Phase 3), combat un-regressed (DESTROYED),
0 crashes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
d68284ede2
commit
0060a3e1ca
@@ -1177,3 +1177,29 @@ void
|
||||
MechControlsMapper::NotifyOfDisplayModeChange(int /*new_mode*/)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// gauge wave P2: BTResolveRosterPilot -- the bridge PilotList (btl4gau3.cpp, the
|
||||
// Comm KILLS/DEATHS roster) uses to read the viewpoint mech's pilot roster. The
|
||||
// roster lives on the mech's ControlsMapper (subsystemArray[0]); this complete-Mech
|
||||
// TU resolves it, PilotList reads the returned pilot at raw BTPlayer offsets.
|
||||
// Faithful to the binary's Execute: **(App+0x6c mech +0x128)[slot] -> GetPilot.
|
||||
//
|
||||
void *BTResolveRosterPilot(int slot)
|
||||
{
|
||||
if (application == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Mech *mech = (Mech *)application->GetViewpointEntity(); // App+0x6c local mech
|
||||
if (mech == 0 || mech->GetSubsystemCount() < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
MechControlsMapper *mapper = (MechControlsMapper *)mech->GetSubsystem(0); // subsystemArray[0]
|
||||
if (mapper == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return (void *)mapper->GetPilot(slot); // FUN_004b0898
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user