Skip to content

Fix of the legless cyborgs when leave transports#567

Open
FS-21 wants to merge 61 commits intoPhobos-developers:developfrom
FS-21:feature/fix-and-allow-legless-repair-in-transports
Open

Fix of the legless cyborgs when leave transports#567
FS-21 wants to merge 61 commits intoPhobos-developers:developfrom
FS-21:feature/fix-and-allow-legless-repair-in-transports

Conversation

@FS-21
Copy link
Copy Markdown
Contributor

@FS-21 FS-21 commented Apr 2, 2022

And a new tag for enabling the old behavior, ideal for repair vehicles.

In the vanilla YR game legless Cyborgs recover legs when leave transports.

Summary by CodeRabbit

  • New Features
    • Introduced the ability for transports to repair legless cyborgs.
  • Bug Fixes
    • Fixed a bug that incorrectly restored cyborg legs when soldiers exited transports.
  • Documentation
    • Updated documentation to reflect new functionalities and bug fixes related to cyborg leg repairs.

and a new tag for enabling the old behavior, ideal for repair vehicles.
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2022

Nightly build for this pull request:

@AlliedG
Copy link
Copy Markdown

AlliedG commented Apr 9, 2022

Omitted CanRepairCyborgLegs= tag from transport and cyborg legs were not reattached (1st image)

Added CanRepairCyborgLegs=true tag to transport and cyborg legs were reattached (2nd image)

https://imgur.com/a/MU3fW82

Interestingly damaged spark anims of cyborg constantly play, even if inside a transport.

@FS-21
Copy link
Copy Markdown
Contributor Author

FS-21 commented Apr 10, 2022

Looks related to OpenTopped logic because standard transports doesn't show sparks.

BUT from what I discovered in vanilla YR tests that "bug" is part of vanilla YR, not caused by this feature so we can consider that this " just works".

@AlliedG
Copy link
Copy Markdown

AlliedG commented May 6, 2022

This no longer requires testing as the sparking in transport due to opentopped is expected? I see some errors with merging?

@DmitryVolkov666
Copy link
Copy Markdown

Works.
But as for me it's better to expand the funcional
For example

1 [General] globally enable or disable the repair of cyborgs inside the transport (default - repair works)

2 [InfantryType] (cyborg=yes) add a pair of keys that prohibit or allow the cyborg to be repaired inside any vehicle (default - repairable)

3 [VehicleType] add a key to a unit that can repair a cyborg/cyborgs (you can try adding an enumeration). in this case, this priority will be higher than priority 2.

@Metadorius Metadorius force-pushed the develop branch 2 times, most recently from 0fa5476 to da80463 Compare May 11, 2022 17:01
@Metadorius
Copy link
Copy Markdown
Member

@FS-21 A friendly reminder to fix the issues.

@chaserli chaserli added the Needs Update This branch needs to be updated with upstream for testing and reviews label Sep 8, 2022
@chaserli chaserli removed the Needs Update This branch needs to be updated with upstream for testing and reviews label Oct 17, 2022
@Metadorius
Copy link
Copy Markdown
Member

@FS-21 I adjsuted the tag name. Please verify if removing any other hooks other than the first one (Limbo one) has any effect on your feature/fix. I suspect the limbo hook is enough to fully accomplish what you want.

I checked and these 3 cases with cyborg infantry:

  • Entering in vehicle.
  • Entering in Structure (a bunker)
  • Entering in a Linked tunnel (Ares tunnels logic)
    And all have in common they execute the hook:
    DEFINE_HOOK(0x51DF42, InfantryClass_Limbo_Cyborg, 0x7)

The problem I see is you have no idea if the cyborg entered into a structure, only transport vehicles ("Transporter") or there are more tags in the limboed infantry related to structures that can be checked in this hook? if not then "DEFINE_HOOK(0x52291A, InfantryClass_InfantryEnteredThing_Cyborg, 0x6)" is for garrison into structures and "DEFINE_HOOK(0x51A27F, InfantryClass_PerCellProcess_AresTunnel_Cyborg, 0xA)" for the Tunnels logic from Ares.

I am not sure I understand what is he issue. All of those are TechnoClasses, so it should be irrelevant whether it enters a tunnel, a transport or whatever. You always have a TechnoTypeClass.

@FS-21
Copy link
Copy Markdown
Contributor Author

FS-21 commented Oct 28, 2024

@FS-21 I adjsuted the tag name. Please verify if removing any other hooks other than the first one (Limbo one) has any effect on your feature/fix. I suspect the limbo hook is enough to fully accomplish what you want.

I checked and these 3 cases with cyborg infantry:

  • Entering in vehicle.
  • Entering in Structure (a bunker)
  • Entering in a Linked tunnel (Ares tunnels logic)
    And all have in common they execute the hook:
    DEFINE_HOOK(0x51DF42, InfantryClass_Limbo_Cyborg, 0x7)

The problem I see is you have no idea if the cyborg entered into a structure, only transport vehicles ("Transporter") or there are more tags in the limboed infantry related to structures that can be checked in this hook? if not then "DEFINE_HOOK(0x52291A, InfantryClass_InfantryEnteredThing_Cyborg, 0x6)" is for garrison into structures and "DEFINE_HOOK(0x51A27F, InfantryClass_PerCellProcess_AresTunnel_Cyborg, 0xA)" for the Tunnels logic from Ares.

I am not sure I understand what is he issue. All of those are TechnoClasses, so it should be irrelevant whether it enters a tunnel, a transport or whatever. You always have a TechnoTypeClass.

I think you missed the point here: Transports & structures decide if legless cyborgs should be repairable if they enter, not vice-versa.

@Metadorius
Copy link
Copy Markdown
Member

I think you missed the point here: Transports & structures decide if legless cyborgs should be repairable if they enter, not vice-versa.

Yeah but your hook in Limbo already has the Transporter pointer. Won't that be enough to decide whether to repair legs or not?

@Metadorius
Copy link
Copy Markdown
Member

Any further input @FS-21? Or maybe someone else could also verify, I am pretty sure there's too much unnecessary code here.

@FS-21
Copy link
Copy Markdown
Contributor Author

FS-21 commented May 20, 2025

Due to the age of the PR, what happens here? just curiosity because no news here since last suggested change :-D

@Metadorius
Copy link
Copy Markdown
Member

All the same, I've looked at the code and suspect that if you only leave Limbo hook -- it will work just fine.

@FS-21
Copy link
Copy Markdown
Contributor Author

FS-21 commented May 25, 2025

Necessary, that limbo call doesn't have data of the bunkers or Ares tunnels.

Case 1:

  • Legless cyborg enters into a transport that CAN NOT FIX legs.
  • Is called -> DEFINE_HOOK(0x51DF42, InfantryClass_Limbo_Cyborg, 0x7)
  • return SkipReset; // (0x51DF53) and pThis->Transporter is NULL
  • Is called -> DEFINE_HOOK(0x51DF42, InfantryClass_Limbo_Cyborg, 0x7)
  • return SkipReset; // (0x51DF53) and pThis->Transporter isn't NULL

Case 2:

  • Legless cyborg enters into a transport that CAN FIX legs.
  • Is called -> DEFINE_HOOK(0x51DF42, InfantryClass_Limbo_Cyborg, 0x7)
  • return SkipReset; // (0x51DF53) and pThis->Transporter is NULL
  • Is called -> DEFINE_HOOK(0x51DF42, InfantryClass_Limbo_Cyborg, 0x7)
  • return 0; // pThis->Transporter isn't NULL

Case 3:

  • Legless cyborg enters into a bunker that CAN NOT FIX legs.
  • Is called -> DEFINE_HOOK(0x52291A, InfantryClass_InfantryEnteredThing_Cyborg, 0x6)
  • return 0; // pThis->Crawling = true; // still unchanged so is still legless
  • Is called -> DEFINE_HOOK(0x51DF42, InfantryClass_Limbo_Cyborg, 0x7)
  • return SkipReset; // (0x51DF53)

Case 4:

  • Legless cyborg enters into a bunker that CAN FIX legs.
  • Is called -> DEFINE_HOOK(0x52291A, InfantryClass_InfantryEnteredThing_Cyborg, 0x6)
  • return 0; // pThis->Crawling = false; // changed the value so now the legs returned
  • Is called -> DEFINE_HOOK(0x51DF42, InfantryClass_Limbo_Cyborg, 0x7)
  • return 0; //

Case 5:

  • Legless cyborg enters into a Tunnel made with Ares logic that CAN NOT FIX legs.
  • Is called -> DEFINE_HOOK(0x51A27F, InfantryClass_PerCellProcess_AresTunnel_Cyborg, 0xA)
  • return 0; // pThis->Crawling = true; // still unchanged so is still legless
  • Is called -> DEFINE_HOOK(0x51DF42, InfantryClass_Limbo_Cyborg, 0x7)
  • return SkipReset; // (0x51DF53)

Case 6:

  • Legless cyborg enters into a Tunnel made with Ares logic that CAN FIX legs.
  • Is called -> DEFINE_HOOK(0x51A27F, InfantryClass_PerCellProcess_AresTunnel_Cyborg, 0xA)
  • return 0; // pThis->Crawling = false; // changed the value so now the legs returned
  • Is called -> DEFINE_HOOK(0x51DF42, InfantryClass_Limbo_Cyborg, 0x7)
  • return 0; //

@Starkku Starkku force-pushed the develop branch 2 times, most recently from b429215 to 280b1c8 Compare June 29, 2025 19:13
@TaranDahl TaranDahl added the ⚙️T1 T1 maintainer review is sufficient label Nov 25, 2025
…ransports

# Conflicts:
#	CREDITS.md
#	docs/Whats-New.md
#	src/Ext/TechnoType/Body.h
@Coronia Coronia requested a review from Metadorius December 17, 2025 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fix and merge this ⚙️T1 T1 maintainer review is sufficient Tested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants