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

Turning car wrong telefrags enemies into car wall #36659

Closed
Grubleafeater opened this issue Jan 3, 2020 · 5 comments
Closed

Turning car wrong telefrags enemies into car wall #36659

Grubleafeater opened this issue Jan 3, 2020 · 5 comments

Comments

@Grubleafeater
Copy link
Contributor

If you turn a vehicle such that a tile which was previously empty becomes occupied by a enemy, the enemy remains in that tile. When the vehicle moves, they take damage from the frame. They are free to move out of the frame and into the inside of the car.

@Soup-de-Loop
Copy link
Contributor

This is an ancient issue and the only thing to alleviate it until the enormous and arduous task of reworking inside vs outside or reshaping vehicles occurs, is to double-wall your vehicle. This problem primarily occurs because of the gaps that appear when the vehicle is diagonal, and the monsters being able to transition through without colliding with a board. Besides that, low-speed collisions with enemies are also good to avoid, as is turning at high speeds.

@Fris0uman
Copy link
Contributor

Duplicate of #5684

@Unrepentant-Atheist
Copy link

That's a "bug"? I though it was a feature of how this system was set up.

@ghost
Copy link

ghost commented Jan 3, 2020

Wow, that is still a thing? Let me check old forks. I've found relatively sufficient crutch for that ages ago (at least monsters walking into angled car part, I suppose you could still 'telefrag' them inside by turning), try this out

--- a/src/monmove.cpp
+++ b/src/monmove.cpp
@@ -221,6 +221,16 @@ bool monster::can_move_to( const tripoint &p ) const
         }
     }
 
+    // guard for unitialized pos() in map::spawn_monsters_submap_group
+    if( position.z != -500 ) {
+        // prevent creatures going diagonally trough vehicle walls
+        const optional_vpart_position vp_from = g->m.veh_at( pos() );
+        const optional_vpart_position vp_to = g->m.veh_at( p );
+        if( ( !vp_to && vp_from && vp_from->is_inside() ) || ( !vp_from && vp_to && vp_to->is_inside() ) ) {
+            return false;
+        }
+    }
+
     return true;
 }
 

@Night-Pryanik
Copy link
Contributor

Closing as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants