Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upNew vehicle bug? #2926
Comments
This comment has been minimized.
This comment has been minimized.
|
I had that happening at one point, but I (thought I) fixed it before the PR got merged. Does it cause an infinite loop that freezes the game? |
This comment has been minimized.
This comment has been minimized.
gbasood
commented
Sep 10, 2013
|
I have this problem as well after building 4ab0886, and it does freeze the game. |
This comment has been minimized.
This comment has been minimized.
|
I have the sneaking suspicion that it's caused by vehicle spawn collisions on the boundaries of submaps. I was getting the message before when it was trying to remove the vehicle from the wrong submap, so some craziness along the edges might be what's going on. EDIT: Drove around three big towns without getting this, it's hard to reproduce. Did you reset the world? Not that that should be causing it... |
This comment has been minimized.
This comment has been minimized.
|
zombie density to 0, and town size to 20 should do the trick Edit: The cause could be that destroy_vehicle() is called during map::shift() |
This comment has been minimized.
This comment has been minimized.
|
Essentially, the reason it fails is that it the wreckage placement, in order to avoid nonsense regarding vehicle rotation and local->global->local coordinate conversions, creates a third vehicle, adds all parts from the two collided vehicles, then deletes the original vehicles and places the new vehicle where the original one was. To get rid of the old vehicle, destroy_vehicle() is called. But if it can't find the vehicle, it aborts with that debug message. However, the attempt to place the wreckage causes a collision with the original vehicle, and the process repeats until the game freezes. |
This comment has been minimized.
This comment has been minimized.
|
Interesting: I improved the debug statement to say the name of the vehicle it couldn't find, and it would give back "Wreckage". Which is quite interesting because I only ever try to destroy the vehicle that the new one spawns on top of. I'm probably setting the submap x/y wrong in the new vehicle, let me see if I can fix that. EDIT: Maybe not. Easy steps to reproduce: Go onto an empty bit of road. Spawn a car with the debug command. Walk 2 square left, spawn again (causing wreckage to form). Repeat until the message appears. I'm pretty sure that it IS something to do with submap boundaries again. |
This comment has been minimized.
This comment has been minimized.
|
Got it! The submap to place the vehicle in was being pre-calculated, but if wreckage was placed then the nonant (whatever that is supposed to be) was wrong. Moving the calculation of it to AFTER the vehicle was ready to be placed fixed the issue. PR going up soon. |
ianestrachan
referenced this issue
Sep 11, 2013
Merged
Fix wreckage freezes, plus small tweaks #2969
kevingranade
closed this
in
3de2153
Sep 11, 2013
This comment has been minimized.
This comment has been minimized.
|
A nonant is a latin term for one ninth of a grid iirc |
minakitty commentedSep 9, 2013
I was playing the new build (c613180) and got this debug message. I know a lot of vehicle updates were added today, and it almost sounds like what @kevingranade was talking about with vehicle wrecks.
