mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- Exhumed: fixed trap setup.
Must clear the structure before the first return and iterate over the walls by reference, otherwise bad pointers will get copied.
This commit is contained in:
parent
beddf1e1ca
commit
e42c3afbea
1 changed files with 2 additions and 4 deletions
|
@ -1210,6 +1210,7 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx)
|
|||
int var_10 = ecx;
|
||||
|
||||
int nTrap = sTrap.Reserve(1);
|
||||
sTrap[nTrap] = {};
|
||||
|
||||
ChangeActorStat(pActor, 0);
|
||||
|
||||
|
@ -1241,12 +1242,9 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx)
|
|||
return nTrap;
|
||||
}
|
||||
|
||||
sTrap[nTrap].pWall1 = nullptr;
|
||||
sTrap[nTrap].pWall2 = nullptr;
|
||||
|
||||
auto pSector = pSprite->sector();
|
||||
|
||||
for(auto wal : wallsofsector(pSector))
|
||||
for(auto& wal : wallsofsector(pSector))
|
||||
{
|
||||
if (var_18 == wal.hitag)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue