[Fixed] "summon" bug
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.
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.
-
- Posts: 1816
- Joined: Wed Jul 16, 2003 7:21 am
- Location: NJ, USA
"summon" bug
When you try to summon something when not in a game, ZDoom crashes.
-
- Posts: 1816
- Joined: Wed Jul 16, 2003 7:21 am
- Location: NJ, USA
-
- Posts: 912
- Joined: Tue Jul 15, 2003 5:12 pm
-
- Posts: 1816
- Joined: Wed Jul 16, 2003 7:21 am
- Location: NJ, USA
-
-
- Posts: 26696
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
OK so summoning something whilst not in game is a stupid thing to do, and logically we shouldn't be surprised if Zdoom crashes when doing it. However, Leha has managed to make Zdoom crash. Now I really don't know, but if Zdoom can crash when doing this, or perhaps some of the other odd things that he seems to want to force Zdoom to do, then perhaps clearing up a crash in this area may help make something else more stable too?
-spoken like someone who really doesn't know what the feck they are talking about I suspect.
-spoken like someone who really doesn't know what the feck they are talking about I suspect.

-
- Lead GZDoom+Raze Developer
- Posts: 49193
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
It'll actually have the opposite effect, Enjay. Basically, the code currently looks like this: (Note: Not an actual programming language... but don't you wish it was?!)
Summon command:
Check for parameter
None? Print usage and return
Search Actors list using parameter
Match not found? Print error and return
Get Player's current position and facing CRASH!
Spawn matching Actor 128 units in front of Player and return
The marked line above is where ZDoom presumably crashes when the game is not in a map (and hence there is no Player to look for). So to fix it, the new code would have to do this:
...
Match not found? Print error and return
Not in game? Print error and return
Get Player's current position and facing
...
That translates to a few opcodes in the compiled EXE, thereby making the code MORE ineffecient, because when the code is used properly (i.e. while in a game), the check is unnecessary.
Of course, this actually amounts to, perhaps, a 0.000001% loss of effeciency, but it certainly won't improve anything.
Summon command:
Check for parameter
None? Print usage and return
Search Actors list using parameter
Match not found? Print error and return
Get Player's current position and facing CRASH!
Spawn matching Actor 128 units in front of Player and return
The marked line above is where ZDoom presumably crashes when the game is not in a map (and hence there is no Player to look for). So to fix it, the new code would have to do this:
...
Match not found? Print error and return
Not in game? Print error and return
Get Player's current position and facing
...
That translates to a few opcodes in the compiled EXE, thereby making the code MORE ineffecient, because when the code is used properly (i.e. while in a game), the check is unnecessary.
Of course, this actually amounts to, perhaps, a 0.000001% loss of effeciency, but it certainly won't improve anything.

-
- Lead GZDoom+Raze Developer
- Posts: 49193
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
-
- Posts: 1066
- Joined: Tue Jul 15, 2003 5:13 pm
- Location: That little island pritch created.
While we're on the subject of spawn bugs... although Randy made it so you can use all three kinds of flechettes at once in a game (!) you can't spawn a certain type except with ACS.
You can't give or spawn a certain kind on the map for testing purposes. Also, using "give all" will only give you the fighter's flechette.
You can't give or spawn a certain kind on the map for testing purposes. Also, using "give all" will only give you the fighter's flechette.
-
- Lead GZDoom+Raze Developer
- Posts: 49193
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Nanami wrote:While we're on the subject of spawn bugs... although Randy made it so you can use all three kinds of flechettes at once in a game (!) you can't spawn a certain type except with ACS.
You can't give or spawn a certain kind on the map for testing purposes. Also, using "give all" will only give you the fighter's flechette.
Sure, but as long as it isn't possible to place Hexen/Heretic items directly in a Doom map this is more a minor annoyance than a real problem. You'd need a script anyway. Implementing a method to use all this stuff directly without ACS and SpawnSpot is much more important than 'give all' being able to give you all types of the flechette (which, BTW, will cause a few minor problems in Hexen.) The timebomb version is equivalent to Heretic's timebomb so if you need that the Heretic version is better anyway.