Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: monsters ignore mechs that aren't being piloted #4083

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

chaosvolt
Copy link
Member

Purpose of change

This sets it so monsters will ignore mechs that aren't currently being ridden.

Fixes #4030

Describe the solution

In monster.cpp, changed monster::attitude_to so that, when checking the attitude towards a fellow monster, monsters with the RIDEABLE_MECH flag are treated as neutral if they currently also lack the ridden effect.

This allows them to still figure out the mech is moving around and acting sus when being ridden if the player is somehow undetectable at the moment (or more amusing and actually-applicable-to-normal-gameplay example, allowing zombies to assume the furniture has abruptly decided to stand up and kidnap their friendly neighborhood player feral).

Describe alternatives you've considered

screm

Testing

  1. Compiled and load-tested.
  2. Made myself undetectable in debug and spawned in a lifter mech.
  3. Spawned in a zombie near the mech, it idled around instead of beelining for the mech.
  4. Put a zombie in a box of mechs with a depleted turret on the other side.
  5. Regular zombies still won't take a swing at a mech to try and escape the lifty boi box, but hulks will.
  6. Set up just a hulk and a lifter near each other to confirm that the hulk doesn't ignore monster attitude and was only swinging because he's an asshole when pathing.
  7. Carded, battery'd, and hopped in a mech before spawning another fresh zed, it immediately spots the now-active mech and comes after it despite the invisible pilot.
  8. Checked affected file for astyle.

Additional context

Ideally zeds would still take a swing at a mech when pathing, same as how they'll bash furniture when pathing, but only real way to do that is to add ATTACKMON and that tends to cause bonus dumb behavior like slapping actual friendlies aside, and in general has a very heavy stink of "barely-used remnant of code from before monster infighting through factions was in the game" to it.

Checklist

@github-actions github-actions bot added the src changes related to source code. label Jan 9, 2024
@scarf005 scarf005 merged commit 8618c68 into cataclysmbnteam:main Jan 9, 2024
12 checks passed
@chaosvolt chaosvolt deleted the mech-is-object branch January 9, 2024 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zombies are hostile to supposedly empty mech suits
2 participants