MantisBT - Zandronum
View Issue Details
0002798Zandronum[All Projects] Bugpublic2016-07-30 20:202018-09-30 22:34
Borg 
 
normalmajoralways
closedfixed 
MicrosoftWindowsXP/Vista/7
2.1 
 
0002798: Thing Z position incorrect on respawned items.
Seems that SpawnPoint[2] is not properly initialized on Spawn chain.
(Or Z pos is reset to FLOORZ somehow?)

We have a MapSpot on map with Z position.
Then we do: SpawnSpot() -> RandomSpawner -> Item
On map start item is positioned properly but after respawn
it lands on floor, not on 3dfloor as we wanted.
Download:
'ftp://borg.uu3.net/home/borg/tmp/3DFLOOR.WAD [^]'
'ftp://borg.uu3.net/home/borg/tmp/chaingun.wad [^]'

Start zandronum: -file chaingun.wad -file 3DFLOOR.WAD +sv_itemrespawn 1
Now aproach lift, go to the roof and pickup chaingun.
Wait for respawn sound... Go to the bottom and open door,
you will find respawned chaingun here.
No tags attached.
Issue History
2016-07-30 20:20BorgNew Issue
2016-07-30 20:37WaTaKiDSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9375#r9375
2016-07-30 21:21BorgNote Added: 0015417
2016-07-31 10:40Edward-sanNote Added: 0015418
2016-07-31 10:40Edward-sanStatusnew => feedback
2016-07-31 11:47BorgNote Added: 0015419
2016-07-31 11:47BorgStatusfeedback => new
2016-09-20 01:09Ru5tK1ngNote Added: 0015671
2016-09-20 01:09Ru5tK1ngStatusnew => resolved
2016-09-20 01:09Ru5tK1ngResolutionopen => fixed
2018-09-30 22:34Blzut3Statusresolved => closed

Notes
(0015417)
Borg   
2016-07-30 21:21   
Okey, after long digging in source code of zandronum, I suspect this one
to be guilty:
bool AInventory::DoRespawn ()
  z = floorz; <- why its here?

I checked code under AActor *P_SpawnMapThing (FMapThing *mthing, int position)
and its calls P_FindFloorCeiling(mobj, true) to locate any 3D floors.
While later, StaticSpawn(...) uses Z from RandomSpawner (Z itself +
SpawnPoint[2] updated), floorz unfortunatly is incorrectly calculated by StaticSpawn itself:
actor->floorz = actor->Sector->floorplane.ZatPoint (ix, iy);

Question is, why that z=floorz is there? It fixes anything else?

Of course, I can be totaly wrong about it.
(0015418)
Edward-san   
2016-07-31 10:40   
Please check GZDoom 1.8.6 and latest zandronum 3.0 beta.
(0015419)
Borg   
2016-07-31 11:47   
I checked 3.0 build 160519-2047 and it works fine.
So it seems its fixed.
(0015671)
Ru5tK1ng   
2016-09-20 01:09   
Based on that, I'll mark this as resolved.