The slot had been there forever to address this same problem but only one of the two constructors actually set it, too bad that it was the wrong one...
This is something that normally won't be noticed. But if some actor is spawned on a moving platform, with both thinkers on the same statnum it means that the order of execution is not correct with the platform being done first, resulting in the actor to 'jump' while the platform is moving. To prevent this it is necessary that all sector movers only tick after all actors have completed their thinking turn.
We have to be extremely careful with the player data, because there's just too much code littered around that has certain expectations about what needs to be present and what not.
Obviously, when travelling in a hub, the player_t should be retained from the previous level. But we still have to set player_t::mo to the PlayerPawn from the savegame so that G_UnsnapshotLevel doesn't prematurely delete it and all associated voodoo dolls, because it checks player_t::mo to decide whether a player is valid or not.
The actual deletion of this redundant PlayerPawn should only be done in G_FinishTravel, after the actual player has been fully set up
* do not skip the player_t init when travelling in a hub. The old player may still be needed in some edge cases. This applies only to singleplayer for now. The multiplayer version still needs reviewing. I left it alone because it may shuffle players around which is not wanted when doing hub travelling.
* do not spawn two temp players in G_FinishTravel. Instead handle the case where no player_t::mo can be found gracefully by adding a few nullptr checks. This temp player served no real purpose except for having a valid pointer. The actual start position was retrieved from somewhere else.
- Fixed properties not having the proper indices.
- Use ViewPos-to-actor instead of measuring actor-to-actor.
- Use the actual camera instead of the actor so camera textures can work.
I wish I had realized this the last time it came up - it would have saved me a lot of trouble.
But as it turns out, the more recent travelling code makes all of this completely unnecessary, working perfectly fine with deleting the player pawns along with the rest of the thinkers before loading the stored ones from the savegame (and getting rid of those in G_FinishTravel.)
And with a sane savegame format that does not depend on side effects from how the thinker serializing handled linking into the lists the old code was even harmful, leaving voodoo dolls behind.
I had the exact same effect when I tried to reshuffle some things for reliably restoring portals, but did not make the connection to interference between two mutually incompatible player travelling mechanisms that just worked by sheer happenstance with the original order of things.
- changed S_GetMusic to return a const pointer to the actual music name instead of a copy. The only thing this is used for is the savegame code and it has no use for a copy, it can work far more efficiently with a const pointer.
After testing with a savegame on ZDCMP2 which is probably the largest map in existence, timing both methods resulted in a speed difference of less than 40 ms (70 vs 110 ms for reading all sectory, linedefs, sidedefs and objects).
This compares to an overall restoration time, including reloading the level, precaching all textures and setting everything up, of approx. 1.2 s, meaning an increase of 3% of the entire reloading time.
That's simply not worth all the negative side effects that may happen with a method that highly depends on proper code construction.
On the other hand, using random access means that a savegame version change is only needed now when the semantics of a field change, but not if some get added or deleted.
- do not I_Error out in the serializer unless caused by a programming error.
It is better to let the serializer finish, collect all the errors and I_Error out when the game is known to be in a stable enough state to allow unwinding.
It turned out this may not be done automatically when opening the savegame - it has to be done later, after the pre-spawned map thinkers and all connected objects have been destroyed.
The object deserializer also has to be rather careful about dealing with parse errors, because if something goes wrong a whole batch of uninitialized or partially initialized objects will be left behind to destroy.
This means that no object class may assume that anything but the default constructor has been run on it and needs to check any variable it may reference.
- always make the top level object randomaccess when opening a JSON file for reading. Some things won't work right if this is opened for sequential access.
- Several mods were able to just take advantage of A_SetRipperLevel and the likes, essentially bypassing this gate so there really is no point in doing this anymore.
This is so that PNGs can be written to memory, not just to an external file. stdio's FILE cannot be easily redirected but a C++ class can.
The writer is very simple and primitive right now, allowing no seeking, but for the job at hand it is sufficient.
Note that large parts of savegame creation have been disabled, because they are about to be rewritten and it makes no sense to adjust them all before.
- converted sound and canvas texture serialization.
- refactored file_zip, so that it can be used to load loose zip files and extract their compressed data directly.
- added handling to FSerializer to generate and consume compressed Zip file entries.
If all goes well this will allow saving savegames as Zips when the rework is done, which will make analyzing them a lot easier.
- fixed a few errors in the ACS module serializer.
- reordered a few things to how they were in the old code.
- optimized serialization of the level.Scrolls array to happen within the sector. This is to allow skipping 0-entries which normally constitute the vast majority of them.
- added sanity checks to prevent a savegame from being loaded with an incompatible map
- refactored a few things to simplify serialization.
- started work on main level serializer function.
The way this was done was a major headache inducer, requiring reconstruction of the function each time the value was changed and in general made actor damage a major hassle.
There was a DECORATE wrapper to mimic the original behavior but this looked quite broken because it completely ignored the different semantics of both damage calculation types.
It also made it impossible to determine if damage was a function or a value.
This accessor has been reverted to what it should be, only returning the constant, which now is -1 for a damage function. I am sorry if this may break the odd mod out but a quick look over some DECORATE-heavy stuff showed that this was never combined in any of them so that accessing 'damage' in DECORATE code depended on an actual damage function.
To get proper damage, a future commit will add a DECORATE function which calls AActor::GetMissileDamage.
actorlist, actornum, monsternum, itemsnum, countitemsnum
Modified the following ccmds:
monster, items, countitems
All commands with "num" at the end simply print a count of their respective filters, all other listed commands now print a list and a count.
TabCommands use an FName to store the command's name so once the NameManager is destroyed its data will become invalid.
This is a problem because C_RemoveTabCommand is being called from FBaseCVar's destructor and most CVARs are global variables.
- Trails now copy pitch, and set the projectile as the target.
- Added GETOWNER flag. Using it sets the owner of the fast projectile as the target instead, if it has an owner.
int SetActorFlag(int tid, str flagname, bool value);
- Mimics DECORATE's A_ChangeFlag
- Returns number of actors affected (number of things with the flag)
- Affects activator if TID is 0
# Conflicts:
# src/p_acs.cpp
It could only work with right to left function argument processing, but with left to right it failed because the ParseExpressionA call altered sc.TokenType.
Note that with register-based arguments on 64 bit platforms this is a very critical issue!
The fixed point version had a mostly useless check that excluded ANGLE_MAX, this got incorrectly converted to floating point.
Note that this version will clamp the angle to 360°, not merely overflow like it did with the fixed point code
The reason for this is that the macOS version uses a deprecated API and in order to correct this, the file needs to be compiled as Objective-C++ which requires a different extension.
It acts as a simple wrapper around P_DamageMobj which can damage a
single actor, but can also set the actor inflicting the damage. It
returns the amount of damage actually done, or -1 if the damaging was
cancelled.
- Crashes occurred if a particular actor was a tracer to the player and the actor was not gone by the time the player unmorphs.
- Failed unmorphs occur if tracer was manipulated through means like A_RearrangePointers, etc.
- Use with FMOD Studio 1.06.x. 1.07 and 1.08 compile but for some reason produce a lot of noise on vanilla Doom sounds.
- Crashes when used with fluidsynth provided by Ubuntu 16.04, but a self compiled version of the library works just fine.
- Reverbs are mostly untested, but implemented.
- Debug waveform drawing is not implemented as it requires a non-trivial amount of work.
- It will still show as FMOD Ex in the menus since I'm too lazy at the moment to make it a "separate" backend.
Since this list is excluded from regular thinker cleaning, anything that may survive through the end of G_FinishTravel will endlessly multiply and severely break the following savegames or just simply crash on broken pointers.
This reverts commit 5ff0abe568.
- use STAT_INVENTORY only for held items.
Seems this was causing some strange issues with hubs, but for items placed in the world it still cannot be allowed to have them in a different statnum.
This addresses a very strange crash I encounteded while travelling in a hub, and ended up with a NULL pointer after the 'Serialize' call which means that some code cleared the variable that is currently being deserialized. I was completely unable to find out what caused this because there is so much recursion going on in the deserializer. All actions on the deserialized actor are now being done with a local copy of that variable so that altering the actual one won't have any adverse effects.
bool CheckActorState(int tid, str statename, bool exact = false);
- Same parameter order as SetActorState
- Returns true if actor has the state; else returns false
This was causing issues with sprite sorting. For this to work as intended, all actors in the world that display sprites need to remain in spawn order, including inventory items.
The only thing this statnum was used for were some bot related search actions which are simply not worth breaking actual maps for some very minor performance gain.
Now Scroll_Texture_Model is working properly again. (Note: Whoever designed this function must have been on drugs - its use of the source data in Boom is completely insane.)