level.CreateCeiling crash

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

level.CreateCeiling crash

Post by Major Cooke »

I'm currently attempting to create compatibility with Hellbound Map29 as several ceilings are too low, blocking cyberdemons from teleporting. However, if you set the line parameter to null, the game instantly crashes at a_ceiling.cpp, line 248 due to a null pointer.

CreateFloor, on the other hand, has a safeguard in place in the event it's null. CreateCeiling just assumes it's there.

Note, it doesn't do a VM abort, the game just outright closes out completely, instantly shutting down.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: level.CreateCeiling crash

Post by Graf Zahl »

What are you trying to do? You cannot call map thinker functions from the compatibility code. Please post your code.
_mental_
 
 
Posts: 3820
Joined: Sun Aug 07, 2011 4:32 am

Re: level.CreateCeiling crash

Post by _mental_ »

I guess you need LevelCompatibility.OffsetSectorPlane() method. As for the initial report, correctly used or not, the crash must be to fixed.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: level.CreateCeiling crash

Post by Graf Zahl »

It shouldn't be able to crash there, unless the function was used in a catastrophically wrong way. And therefore I can't fix it without seeing what was done wrong here.
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: level.CreateCeiling crash

Post by Major Cooke »

Code: Select all

double val = 64;
level.CreateCeiling(level.sectors[3044], Ceiling.ceilRaiseByValue,	level.lines[28656], val, 0, val);
level.CreateCeiling(level.sectors[245], Ceiling.ceilRaiseByValue,	level.lines[28664], val, 0, val);
level.CreateCeiling(level.sectors[990], Ceiling.ceilRaiseByValue,	level.lines[28660], val, 0, val);
level.CreateCeiling(level.sectors[3045], Ceiling.ceilRaiseByValue,	level.lines[28652], val, 0, val);
level.CreateCeiling(level.sectors[3239], Ceiling.ceilRaiseByValue,	level.lines[28327], val, 0, val);
level.CreateCeiling(level.sectors[3251], Ceiling.ceilRaiseByValue,	level.lines[28335], val, 0, val);
level.CreateCeiling(level.sectors[3235], Ceiling.ceilRaiseByValue,	level.lines[28331], val, 0, val);
level.CreateCeiling(level.sectors[3243], Ceiling.ceilRaiseByValue,	level.lines[28323], val, 0, val);
Even this crashed though, with the same thing. Lines was turning out null.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: level.CreateCeiling crash

Post by Graf Zahl »

You do that from the compatibility handler? No wonder it crashes, at that point the level isn't fully initialized, and adding checks for that to every function imaginable is way too much work. In particular the lines array in the sector is still empty at this time, because line properties can be changed from compatibility handlers, including the sector reference.
These functions are not for raising the ceiling but for creating a ceiling movement thinker.

If I could I'd just block off access to the level there, but that'd render the class useless. Unfortunately that exposes all of Level's functions to the handler, even though most of them would probably crash.
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: level.CreateCeiling crash

Post by Major Cooke »

What should I do then? Those ceilings in particular need to be adjusted somehow or that map will never allow for 100% kills.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: level.CreateCeiling crash

Post by Graf Zahl »

_mental_ wrote:I guess you need LevelCompatibility.OffsetSectorPlane() method. As for the initial report, correctly used or not, the crash must be to fixed.
This. The compatibility handler should only use its own interface.
Post Reply

Return to “Closed Bugs [GZDoom]”