gruppe-adler / grad_trenches

Visual Upgrade for Trenches
Other
18 stars 19 forks source link

[Bug] Trench preview's collision causes mayhem #125

Open IS4Code opened 2 years ago

IS4Code commented 2 years ago

Tested on version 1.6.8.9.

We've got ourselves in a situation where the trench's preview model caused a vehicle to explode. It's unfortunate for this to be happening in otherwise such an amazing mod.

Steps to reproduce in multiplayer:

If there is a driver in the vehicle, it seems not to happen, as the driver (likely) has full control over the vehicle and doesn't let it explode. If there is no driver, anyone could synchronize the vehicle to explode with the preview model, as long as the vehicle's collision is triggered (via shooting or contact with another vehicle).

Steps to reproduce in singleplayer:

This is not something that should happen, the preview should have absolutely no collision (even though it is only a local object).

nomisum commented 2 years ago

thank you for the report.

looking at the code i see no quick fix for this. simulation is already disabled for the trench preview (& the same way ACE does it). no idea whats happening here. enablesimulationglobal should work for local objects too.

maybe @AdlerSalbei has an idea.

my only suggestion would be to try and use only a local enableSimulation command instead of serverEvent. maybe the global EH execution fails when the server does not know the object. this would mean the bug is inside ACE as well.

did you reproduce without grad trenches / only ACE by any chance @IllidanS4 ?

AdlerSalbei commented 2 years ago

You can not reproduce it with ACE. They are using a different system. But it is a quite interesting Issue. I'll have a lock at it.

IS4Code commented 2 years ago

We had been using the trenches from ACE for years and I don't recall the bug ever happening, but I also can't say we've specifically tested that. By the way we are using this version of ACE in case it would be relevant.

IS4Code commented 2 years ago

Not sure if you had an idea how to fix this, but I don't think there is a good way to do this from script. It seems disableCollisionWith overwrites any previously set state, so using it could pose a danger for scripts that rely on this.

Why not simply create two models for each trench, one with and one without collision data? Then the preview could simply use the object without collision, and no need to try to come up with a script solution.

nomisum commented 2 years ago

thats how ace does it, certainly a viable approach