mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- fixed: When linking an actor into the blockmap multiple portal groups, AActor::LinkToWorld would delete the links to the previous nodes for each new group. This was causing random crashes when the affected actor was deleted by the garbage collector.
This commit is contained in:
parent
aff8b00575
commit
9e847c252b
1 changed files with 2 additions and 2 deletions
|
@ -459,6 +459,8 @@ void AActor::LinkToWorld(bool spawningmapthing, sector_t *sector)
|
|||
|
||||
P_CollectConnectedGroups(Sector->PortalGroup, Pos(), Top(), radius, check);
|
||||
|
||||
BlockNode = NULL;
|
||||
FBlockNode **alink = &this->BlockNode;
|
||||
for (int i = -1; i < (int)check.Size(); i++)
|
||||
{
|
||||
DVector3 pos = i==-1? Pos() : PosRelative(check[i] & ~FPortalGroupArray::FLAT);
|
||||
|
@ -470,11 +472,9 @@ void AActor::LinkToWorld(bool spawningmapthing, sector_t *sector)
|
|||
|
||||
if (x1 >= bmapwidth || x2 < 0 || y1 >= bmapheight || y2 < 0)
|
||||
{ // thing is off the map
|
||||
BlockNode = NULL;
|
||||
}
|
||||
else
|
||||
{ // [RH] Link into every block this actor touches, not just the center one
|
||||
FBlockNode **alink = &this->BlockNode;
|
||||
x1 = MAX(0, x1);
|
||||
y1 = MAX(0, y1);
|
||||
x2 = MIN(bmapwidth - 1, x2);
|
||||
|
|
Loading…
Reference in a new issue