This new function returns a string representing the type of userdata the variable given (e.g. mobj_t, player_t), it even works on "minor" userdata types (player_t.powers, skin_t.soundsid, sector_t.lines, etc)
Lua additions
Thought I'd may as well make a merge request so I can remind people of all the various Lua-related changes here (and because it's about time some of them got in):
* Added `P_PointOnLineSide(x, y, line)`. Allows you to quickly determine which side of a line faces the point. *line* can be a real line_t or a custom defined line (just like with P_ClosestPointOnLine).
* Added seg_t and node_t support to Lua (note: these are disabled for now, due to complications with OpenGL that we all know something of by now. Bit of a shame really :( ) - of note is node.children and node.bbox:
* node.children[] is an array that takes 0 or 1 as indexes (or "right" and "left", alternatively)
* node.bbox(child,bboxcoord) is a two-arg function: child can be 0 or 1 (or "right" and "left", alternatively), bbox coord can be 0,1,2 or 3 (or "top", "bottom", "left" and "right", alternatively)
* aside from the above, segs[] and nodes[] store the segs/nodes of the current map; segs.iterate and nodes.iterate iterates through segs/nodes
* NF_SUBSECTOR is also available for usage with node.children
* You can now get the palette indexes (i.e. colormap[n]) of colormap userdata from `v.getColormap`, where n is a palette index number between 0 and 255. Useful for finding out which palette colors turned into what, if they changed at all
* ffloor_t userdata can now save to and be read from $$$.sav in netgames properly; this means custom mobj/player variables and NetVars can both send/recieve them directly if you wanted
* **IMPORTANT** Blockmap search library! (with a new file: lua_blockmaplib.c)
* Format of iteration function: `searchBlockmap(searchtype, function, mobj, [x1, x2, y1, y2])`. Returns true if search was uninteruppted, false if the iteration function returned true at any point
* *searchtype* can be either "objects" or "lines", for looking for mobj_t and line_t stuff in the blockmap respectively
* *function* is a function of your choice to iterate with: (sorry I can't get the next two bullets to be one indent further to the side)
- format of function needed: `funcname(mobj, foundmobj)` or `funcname(mobj, foundline)` (for searching for objects and lines, respectively)
- return value of *function* affects searching somewhat: nil doesn't change searching, false ends searching in a block (but doesn't stop searching, it just moves onto the next), and true ends the full search. Both returning true or false ultimately makes `searchBlockmap` return false.
* *mobj* is the reference mobj that you're checking around (if you don't supply x/y ranges to search in, it defaults to checking within the mobj's radius in both axes). If *mobj* was removed mid-search the search stops and `searchBlockmap` returns false
* (optional) *x1, x2, y1, y2* are coordinates on the map to search the blockmap between, if given
See merge request !54
Hardcoded VAda Flickies
Many thanks to MI for his help, even if he has sinful opinions on what the collection of creatures should be called. ;P
* Flickies are now handled via A_FlickySpawn instead of hardcoded in P_KillMobj, so there can be mobjtypes with MF_ENEMY which don't create flickies, or other mechanisms which can much easier.
* Added map header "FlickyList" (aka "AnimalList") parameter, which can either be set to:
* A species (eg: "Rabbit" or "Bluebird", amongst 17 currently supported types in dehacked.c table FLICKYTYPES - including the seed from Sonic CD, which isn't limited to 'soniccd on' in the console now)
* Any valid mobjtype that isn't MT_NULL (eg: "MT_FLICKY_GHOST")
* A comma-seperated list of either of the above, up to 64 entries long (eg: "Cow,MT_FLICKY_SPIDER,Chicken")
* "All" - sets behind-the-scenes stuff to use every 'normal' type of flicky in FLICKYTYPES (a distinction which can be utilised to hide secret level flickies where they wouldn't be appropriate for the main game)
* "Demo" - sets behind-the-scenes stuff to use the five flickies closest to the species used in the game's long history.
* "None" - prevents any flickies from spawning.
"Demo" is functionally the default value if you don't include a FlickyList parameter in the header at all.
Of note, a bunch of functions are now created:
* A_FlickySpawn - spawns flicky.
* A_FlickyAim - aims for area near target, but not directly on them - turns around when hitting wall
* A_FlickyFly - flies/swims around target (calls A_FlickyAim)
* A_FlickySoar - hacky alternate fly (calls A_FlickyAim)
* A_FlickyCoast - slowing down before going off again
* A_FlickyHop - fracunit-scale precision for A_BunnyHop
* A_FlickyFlounder - A_FlickyHop with randomisation
* A_FlickyCheck - State-setter for falling, or being on-ground
* A_FlickyHeightCheck - State-setter for falling, or being below a certain height relative to target
* A_FlickyFlutter - A_FlickyCheck, but with a slow fall/movement (calls A_FlickyCheck and A_FlickyAim)
I don't need to enumerate the object types and states that have been added, do I?
Oh yeah, I also made it so get_mobjtype's failure value was MT_NULL and prohibited SOC from editing the properties of it to compensate.
IN ADDITION: Killed "soniccd" console command, since it made things more complicated and honestly being able to specify Sonic CD seeds in the level header is a better option.
See merge request !60
Savegame hotfixes
Yes, this another netgame related fix! Named this "savegame hotfixes" rather than "ERCZ hotfix" or the like in advance of the fact we probably need a general branch for other $$$.sav fixes?
Anyway, fixes included in by this branch:
* ERCZ's lava falls now act as expected rather than being stuck in place for the map's duration, fixing all other known desynchronisation issues known in the map for the time being (yay)
* Changing sector tags in a map no longer causes joiners to netgames to have their SRB2 application stop responding etc
* Player names should no longer turn red in the console in gametypes outside of CTF/Team Match if a resynch occurs (not $$$.sav related, but it's related to netplay so I lumped it in anyway)
See merge request !150
One Eggscalibur fix
Use mobj->watertop instead of mobj->spawnpoint->z. CEZ3 is far from fixed in multiplayer, but this is still one less thing to worry about.
See merge request !148
Software plane rendering fixes/cleanup
This is mostly cleanup, with the exception that polyobject planes should now behave somewhat better than they do in 2.1 currently (translucent polyobj planes should now always be actually translucent regardless of where you view them from, for instance). I can't claim I've fixed their rendering once and for all though, there may still be bugs for all I know...
See merge request !136
Some texture-related fixes
Bugs fixed in this branch:
* upper/lower/middle textures with non-existent texture ids being capable of crashing the game. For instance, RVZ1 has colormap codes on non-colormap linedefs, which causes them to wind up with invalid texture ids because of how the game tries to interpret lower/upper textures with "#" followed by characters on normal linedefs. Fortunately these "textures" are normally not visible anyway (since they're all in control sectors) unless they are swapped with in-level textures by some crazy Lua script of some sort...
* animated single-patch textures with holes displaying garbage on first viewing (see this thread: https://mb.srb2.org/showthread.php?t=42195)
* the heights of the lighting (shadows or colormapping) from water/translucent/shadowcasting/etc FOFs become messed up when displayed on repeated midtextures.
See merge request !144
Flat changing hotfix
This should fix how Lua scripts that change flats in levels, particularly to flats that don't already exist in the level, cause SRB2 to crash for anyone who joins a netgame afterwards. (I'm not sure if it's a consistent thing or not though)
Probably needs a good test to verify the issue is completely fixed before being merged in. Maybe there are other minor things I didn't account for in this fix? I don't know!
See merge request !141
Dunno who thought it was a good idea to lump tag, nexttag and firsttag together in $$$.sav, but that meant changing sector tags caused SRB2 to stop responding since it lead to the tag lists being broken
This fixes ERCZ's lava falls not moving after joining a netgame at that stage. Possibly explains other various floor/ceiling related netgame quirks that haven't been noticed until now, maybe even in multiplayer levels.
Remove secplanes
This is just removing SSNTails's old port of ZDoom's secplane code and math, from back when he attempted slopes himself. The slopes we've had since 2.1.15 however do not need these, so we can pretty much toss the code for them out now (nothing uses them anyway).
See merge request !149
Savegame hotfix
This fixes the first mobj thinker added/read from $$$.sav not being relinked to other objects as their target/tracer/etc properly. In particular, this fixes Brak's electric shield disappearing for anyone joining a netgame playing ERCZ (as Brak happens to be the first object added/read in this case, and Brak is the shield's target).
See merge request !146
-Updated packet name list so the debug file no longer shows garbage packet names
-Replaced byte values with actual net command names in the debug file. Only the first net command in a packet will be shown though
-Added a MOBJCONSISTANCY define that makes the game takes all revelant mobjs to be counted in the synch seed
-Added a PACKETDROP define that adds two console commands "drop" and "droprate" to simulate bad internet by dropping packets
-Added/changed comments here in there in the netcode
-Fixed a minor error that would ignore one of the urgent ack slots
-Added a space between the map name and "zone" for the messages shown in a joiner's console
This fixes Brak's electric barrier disappearing for joiners to ERZC. There seems to be some issues with the lava falls there too I've found, but the electric barrier actually stays around now at least
* Set the default flicky group to be equivalent to Flickylist = Demo.
* Refactored a little. (This also removed a crash-causing typo in a Z_Free in P_ClearSingleMapHeaderInfo.)
* MT_EXPLODE's anims partially FF_ANIMATE'd.
* A_FlickySpawn turned into a wrapper for internal function that does what A_FlickySpawn did but returns a pointer to the spawned flicky.