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

Mutinous fish et al #37947

Closed
Funguss opened this issue Feb 12, 2020 · 5 comments
Closed

Mutinous fish et al #37947

Funguss opened this issue Feb 12, 2020 · 5 comments
Labels
Monsters Monsters both friendly and unfriendly. (S1 - Need confirmation) Report waiting on confirmation of reproducibility Vehicles Vehicles, parts, mechanics & interactions

Comments

@Funguss
Copy link
Contributor

Funguss commented Feb 12, 2020

Not really a mutiny, but I liked the idea and thought it sounded catchy. Sorry. Earlier, I was going for a little sail on my new canoe. A fish popped out of the water right where I was standing! It was a warmouth! Somehow, I was displaced but yet I was still driving. However, I wasn't really driving, as the fish had become the driver. I passed a few turns without realising what had happened, by which point my sailboat had gotten quite far away from me. I tried to move and got the following error...

captain warmouth

As you can see, there goes Captain Warmouth of the Swift, the most cunning pirate fish of the Cataclysm. Damn that handsome rogue.

Unfortunately, I was too preoccupied with the screenshot to remember the debug log. I still think I had my priorities right, even if it's not as helpful. I mean, that boat is a sail boat. Imagine that. Seriously. I insist.

Steps To Reproduce

Honestly, I can think of no way to reliably reproduce this beyond dumb luck or a long and boring stint in the map editor combined with the building of a boat.

Expected behavior

Fish don't jack yo' ride.

Version

  • OS: Windows
    • OS Version: MINGW/CYGWIN/MSYS2 on unknown Windows version
  • Game Version: 0.D-12105-gda56791 [64-bit]
  • Graphics Version: Tiles
  • Mods loaded: [
    Dark Days Ahead [dda],
    Aftershock [aftershock],
    C.R.I.T Expansion Mod [crt_expansion],
    Magiclysm [magiclysm],
    Makeshift Items Mod [makeshift],
    More Survival Tools [More_Survival_Tools],
    Mythological Replicas [nw_pack],
    Hydroponics [hydroponics],
    Mutant NPCs [mutant_npcs],
    No Rail Stations [No_Rail_Stations],
    Folding Parts pack [deoxymod],
    Vehicle Additions Pack [blazemod],
    Tanks and Other Vehicles [Tanks],
    Roadheader and other mining vehicles [Heavy miners],
    No Fungal Monsters [No_Fungi],
    Beta National Guard Camp [national_guard_camp],
    ]
@mlangsdorf mlangsdorf added <Bug> This needs to be fixed Monsters Monsters both friendly and unfriendly. Vehicles Vehicles, parts, mechanics & interactions labels Feb 12, 2020
@mlangsdorf
Copy link
Contributor

Well, yeah, that's a bug. But why?

Aha! When a vehicle collides with a monster in water, it pushes the monster out of the way, unless the monster is on a boardable part, in which case it assumes the monster is a legitimate passenger. This is done to keep your car from running over your dog riding shotgun. But it doesn't check if there's already someone at that location, which means monsters can get picked up by vehicles if they collide with the driver. Then, the next time the vehicle moves, the vehicle movement code keeps moving passengers until there aren't two passengers at the same location. Net result, you get boatjacked by a fish, but the game thinks your still driving until you try to get off the boat.

This should fix all that, but I'll need to compile and test it:

diff --git a/src/vehicle_move.cpp b/src/vehicle_move.cpp
index 5f22d25f51..81fb6cc8a6 100644
--- a/src/vehicle_move.cpp
+++ b/src/vehicle_move.cpp
@@ -466,8 +466,10 @@ veh_collision vehicle::part_collision( int part, const tripoint &p,
     }
 
     if( is_body_collision ) {
-        // critters on a BOARDABLE part in this vehicle aren't colliding
-        if( ovp && ( &ovp->vehicle() == this ) && get_pet( ovp->part_index() ) ) {
+        // critters on a BOARDABLE part in this vehicle aren't colliding, unless there's already
+        // a passenger there
+        if( ovp && ( &ovp->vehicle() == this ) && get_pet( ovp->part_index() ) &&
+            !get_passenger( ovp->part_index() ) ) {
             return ret;
         }
         // we just ran into a fish, so move it out of the way

@Funguss
Copy link
Contributor Author

Funguss commented Feb 12, 2020

Well, yeah, that's a bug. But why?
For a moment there I thought you meant this was a feature, and in that moment I kind of agreed it should be.

Nice one on the fix! It occurred to me earlier that with map editor you could fill a large area with water and fish using the big paintbrush, so I hope that helps with testing.

Also, I forgot to mention this before, but the fish may have surfaced beneath me, or during the move. I'm not entirely sure. It was very recent either way.

@Night-Pryanik
Copy link
Contributor

I tried to reproduce this issue on 0.F-10876, but to no avail.

I debug-spawned ~100 salmons next to me sitting in the canoe. Then I sailed through this salmon mass here and back again for about dozen times. No salmon conducted boatjack, no errors popped up.

For now I'm removing Bug tag and adding Need confirmation tag.

@Night-Pryanik Night-Pryanik added (S1 - Need confirmation) Report waiting on confirmation of reproducibility and removed <Bug> This needs to be fixed labels Aug 27, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@github-actions github-actions bot added the stale Closed for lack of activity, but still valid. label Dec 5, 2022
@kevingranade
Copy link
Member

Going to call this closed.

@anothersimulacrum anothersimulacrum removed the stale Closed for lack of activity, but still valid. label Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Monsters Monsters both friendly and unfriendly. (S1 - Need confirmation) Report waiting on confirmation of reproducibility Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

No branches or pull requests

5 participants