Tweaks to R_PointToAngle and R_PointToAngle2
Exactly what it says in the title! See commit description for more information on what I did, since I'm too lazy to write it all up a second time. =P
Could someone check that these changes don't cause anything else in particular to go wrong in the game or source code? I haven't checked myself that much yet, mostly because I totally forgot about this thing until now, lol.
See merge request !19
Spring fixes
Remember how a while back I fixed things like being stuck under a spring after jumping from below? Or how you could touch multiple springs at the same time and subsequently cause a loud racket? I accidentally broke something else in the process it turns out! (this sounds familiar...)
Namely, diagonal springs can't send you to their centers anymore, because of several changes I made to player-spring collision towards the other issues. This branch fixes that particular issue, while making sure none of the old bugs were broken again. Took a lot of testing to make sure of this.
As a bonus, the P_DoSpring function returns a boolean now, which can be used by Lua for whatever: true = you touched spring; false = you didn't
See merge request !20
Polyobj setup fixes
If you're wondering why ERZ2 crashes lately, yes, it's my fault once again it turns out! Ideally we shouldn't have loose spawn points or anchors without an actual PolyObject to go with them in the first place, but this fix re-adds the safety check that prevented them from crashing the game before.
If it wasn't clear already, this fix is rather important, so please get in asap.
See merge request !7
Rerevert unreversion of reversion
This commit got overwritten somehow when things were being merged into master. It's kind of important. A lot of maps will break without it.
See merge request !6
New player animations (Updated player.dta Sonic)
Adds support for several completely new player animations, mostly for Super Sonic.
See merge request !5
Note: Before this change, North and West directions would be returned as ANGLE_90-1 and ANGLE_180-1. This caused the pusher polyobjects in THZ2 to slowly move sideways as a side-effect (and probably caused similar bugs in the past too, these functions have barely been touched in a decade it turns out.)
Goo Water (THZ Goop) adjustements
At Nev3r's request:
Adjusted goop so that you spend less time bouncing around in it. The goop will become a walkable surface with a higher velocity threshold.
The actual goop physics haven't been altered as far as the initial entrance and underwater time is concerned, only leaving goop and subsequent bounces has been dampened significantly.
See merge request !7
finesine table
I pasted in finesine from #11 and made a merge request.
This has been lightly tested to ensure the renderer doesn't immediately break. No ill effects have been observed so far.
See merge request !17
A_SetObjectFlags tweak
Only reset the sector/blockmap links on an object calling A_SetObjectFlags if the MF_NOSECTOR|MF_NOBLOCKMAP flags change. Fixes a freeze related to LD442 demonstrated in MascaraSnake's example WAD at https://dl.dropboxusercontent.com/u/27962790/statetest.wad .
See merge request !11
Re-add/fix broken platform momz mobj code.
The changes in this branch re-add the platform's momentum to players and mobjs which leave the platform (eg. by jumping) so that they move with relative velocity as expected. This behavior was unintentionally broken in SRB2 2.0, which adds a lot of artificial difficulty to certain segments of the levels, where you have to jump between high velocity moving platforms which seemingly cut your jump height to nothing.
Not only has the behavior been fixed, but it has now been enhanced to move the camera while free-falling between platforms as well, completing the illusion of full relative velocity with minimal hiccups. [Observe.](http://i.imgur.com/zmSfUyp.gifv)
See merge request !14
Miscellanous fixes to merge
These are the commits from the "miscellanous-fixes" branch that are okay to merge in.
Bugs fixed include the following:
* CTF flags respawning incorrectly: they cannot z position themselves correctly, and they cannot flip themselves.
* The weird "jumping" spring/monitor effect: this is the result of an internal mobj_t pointer (tmfloorthing, specifically) not resetting itself to NULL for the next object's thinker, resulting in Z movement code thrusting the object vertically at tmfloorthing->momz.
See merge request !18
... because some things (Lua. custom header entries) move it.
https://mb.srb2.org/showthread.php?t=40580
(Technically breaks netgame compatibility for Lua-heavy mods, so in next.)
That's supposed to be run once a frame, not once per hook
per mobj per frame you moron. If you just run it seven
thousand times a frame, of course your framerate will drop.
Dummy, what do you think you're doing? If you
just push mobjs and players into Lua all willy-
nilly everywhere, you'll wind up generating
tons of metatables and stuff you arne't even
gonna use!
Oh. Thanks me, I'm really smart.
This _should_ solve some significant performance
issues Lua experiences. If not, I will be very
upset for having wasted so much time and effort.
There will be bugs, this kind of thing needs to
be thuroughly tested and this is just the first
iteration of it.
Assume that every frame the player is on the ground, their pmomz will
be re-set properly if the floor is moving, therefore if the platform
STOPS, we need this to set it to 0.
This fixes the issue with upside-down springs shooting downwards if you touch another of its kind. Also fixes one of the issues with monitors in Icicle Falls (after you phase inside the East-most float-bob FOF's monitor via the other bug and jump up to break it while there, the NEXT monitor moves upwards too)
Here's how it works: When a player walks off the
moving platform, it applies their pmomz once, and
then _keeps pmomz set_ so that the camera still
adds pmomz to its movements until they hit another
floor. This way, the camera doesn't jerk around.
Also gain velocity from walking off an "up" elevator normally?
This _looks_ incorrect because the camera stops matching
the platform movement the moment you step off, but I
assure you it is a correct and accurate movement.
(Try it with chasecam off.)
Now players will apply platform movement when jumping,
but only if the platform is moving the same direction
as their jump is, and all other objects will have an
appropriate pmomz in reverse gravity FOF situations.