Commit Graph

107 Commits

Author SHA1 Message Date
toasterbabe 17e0adcbac Renamed some struct variables so the problem this branch sets out to fix is more obvious at a glance.
* m_snext ==> m_thinglist_next
* m_sprev ==> m_thinglist_prev
* m_tnext ==> m_sectorlist_next
* m_tprev ==> m_sectorlist_prev
2016-06-09 14:16:02 +01:00
toasterbabe 0b920ee249 You know that problem where you bumped on the edges of Mario blocks and Bustable blocks and Bouncy FOFs sometimes? Wham. Bam. In the van.
Issue was caused by attempting to traverse the sector's thing-touching-list across all the things in the sector (which would inevitably have the same sector as the first node in mobj->touching_sectorlist) instead of traversing the thing's sector-touching-list (which has the same thing but different sector references).

I wonder how many times AJ copypasted this code with absolutely no idea why it wasn't working properly. I'll figure that out tomorrow, maybe set up some compiler macros so this mistake is never made again. For now, I must sleeb.
2016-06-09 00:02:50 +01:00
Monster Iestyn 8ceba95bfa Fix slope collision detection for the camera
See http://mb.srb2.org/showthread.php?t=41494
2016-05-25 21:10:46 +01:00
Inuyasha ab7af594d9 Merge branch 'nights-hotfix' into 'next'
NiGHTS hotfix

Fixes the following issues relating to playing as NiGHTS Super Sonic that apparently popped up between 2.1.14 and next (mostly due to the changes to SRB2's trig stuff it seems):
* Super Sonic drifts to the side at some angles around an axis, and is unable to go directly upwards or downwards as a result
* Drilling to the side when on the ground causes the drill sound to constantly restart
* CEZS's start not actually being lined up properly with the first axis means the player is not able to go backwards along the track (because the player is not actually aligned with the track properly, preventing you from touching the attached line transfer)
* trying to hug some walls such as the tall wall before the library section of CEZS allows Super Sonic to go through them

These fixes needs proper testing before this branch can be merged in, in case they accidentally break other things as a result or something.

See merge request !71
2016-05-18 07:09:05 -04:00
Inuyasha f07585191b copyright dates/statements updated and such
(no actual SLOC changes)
2016-05-17 17:42:11 -07:00
Monster Iestyn e3dac00aa9 If player is at wrong distance from axis, correct x/y position in a similar fashion to how momentum is set for homing attacks. Don't use trig here for most cases since that just re-introduces the side drift issue and friends all over again.
This fixes the CEZS issue where the player start is not actually on the track, preventing the player from going backwards until they hit a wall.
2016-05-16 19:00:34 +01:00
Monster Iestyn 89ce257248 Fix all the NiGHTS issues in one fell swoop (assuming they are fixed, that is, lol)
Basically I kind of worked around any potential trig inaccuracies by not using the player position directly for setting momx/momy. This way, if player->angle_pos == player->old_angle_pos, momx/momy are zero
2016-05-14 23:57:56 +01:00
Monster Iestyn 947e8c56ec Removed redundant momx/momy assignment from NiGHTS movement code.
Specifically, the being-hit code, where P_NightsTransferPoints is called afterwards anyway
2016-05-14 22:52:12 +01:00
Inuyasha 987f65fde8 Merge branch 'demo-replay-fixes' into 'next'
Demo replay fixes

Changes made/bugs fixed in this branch:
* Replay camera is now controllable when climbing (https://mb.srb2.org/showthread.php?t=38668), and in waterslides
* localangle (read: the angle between you and the camera, I think) now doesn't change during demo replays in most situations, unless the player is in analog mode. Exceptions include zoomtubes and NiGHTS super
* Replay camera now doesn't act silly if the player is in analog mode (assuming you also recorded it in that mode to begin with, anyway)

See merge request !66
2016-05-07 06:17:39 -04:00
Nipples the Enchilada fe20a35aee Disable camera rotate buttons if you aren't viewing yourself
They don't affect what you're viewing anyway and cause cam_rotate to get
messed up.
2016-05-07 04:51:54 -04:00
Monster Iestyn 300275534f Merge branch 'next' into demo-replay-fixes 2016-05-03 15:10:30 +01:00
wolfy852 969a254cb6 Remove the super float from non-Sonic characters
Should fix conflicts with Lua-scripted jump spin abilities.
2016-04-30 14:59:51 -05:00
Monster Iestyn ac3de70c93 Merge branch 'slope-fixes' into 'next'
Slope fixes

This branch fixes the following slope-related physics and rendering bugs:

* Rings in multiplayer stages respawning inside slopes (even despite being able to spawn ABOVE them on map load)
* Player starts spawning players inside slopes
* Elemental flame trails not appearing if a player spindashes UP a slope; see issue #21
* Dying players "jumping" off slopes to the side if they were previously standing on one
* Some issues with FOF slope rendering
* Various issues with sprites displaying through walls adjacent to slopes

Other features added:
* Objectplace now supports slopes (this is Inuyasha's doing)
* Automap in DEVMODE now supports slopes (my doing)

Just making this merge request now rather than later, ~~in case I decide not to make any more fixes for the time being~~ (this branch doesn't seem to want to die lol), and so we can get these merged in as soon as the code's all been checked over.

See merge request !50
2016-04-26 17:21:27 -04:00
Inuyasha b288d8a399 Merge branch 'bp_random2' into 'next'
xorshift* PRNG

This needs testing to ensure I didn't mess anything up switching function names around.

Our PRNG sucks. This is probably obvious. I wish I had known better at the time I implemented it, but oh well.

The replacement is an xorshift* PRNG variant with period 2^32 - 1 (meaning that the PRNG state will loop after four billion calls ... that's not likely to happen), versus the old PRNG's period of about 2^22 (?). The output is also much more random and less predictable; the old PRNG would fall into a predictable loop of output after about 4000 numbers were generated, which isn't much.

The PRNG here also outputs numbers as fixed point from [0,1) (that's 0 to FRACUNIT-1, in other words) instead of single bytes at a time. This makes it much easier to calculate things for, say, P_RandomRange and P_RandomKey. A new macro, P_RandomChance(p), is now in use that returns true _p_ percent of the time, where _p_ is a fixed_t probability from 0 (0%) to FRACUNIT (100%).

This doesn't affect netgames at all; the code for seed saving and restoring is identical (aside from a check to prevent seed being set to 0, which breaks xorshift PRNGs). Demos break, but A: _duh_ and B: they're already broken by all the changes to physics to accommodate slopes.

P_Random is deprecated in Lua, as the function was renamed to P_RandomByte. Aside from that, nothing special.

See merge request !64
2016-04-24 18:03:13 -04:00
Monster Iestyn b8cc36dfd1 P_LookForEnemies should not change the player's angle until the target has been decided
This fixes a quirk with Shadow with chaos control sometimes throwing the player in the wrong direction
2016-04-22 22:28:00 +01:00
Monster Iestyn c833f3845f Merge branch 'next' into bp_random2 2016-04-20 18:18:28 +01:00
Monster Iestyn e05951e213 Merge branch 'next' into slope-fixes 2016-04-20 18:17:14 +01:00
Monster Iestyn 60ec0ff294 Merge branch 'next' into demo-replay-fixes 2016-04-20 18:15:36 +01:00
Inuyasha 3b4b7a05fd Better CTF in splitscreen, no death message for spectators 2016-04-06 19:55:58 -07:00
Inuyasha 3117a6a16e Splitscreen fixes
initialize flipcam2
player 2 gets game over music now.
restore the other player's music when the dead player is done sulking about their game over
2016-04-06 18:28:43 -07:00
Monster Iestyn 29f0301540 Whoops 2016-04-05 21:21:45 +01:00
Monster Iestyn e8a4d7b7b8 Fix replay camera not being turnable when climbing, sliding ...and several other things.
If in analog mode, this does not apply (also analog mode replay camera no longer borks)
2016-04-05 20:56:48 +01:00
Alam Ed Arias 1c16943be8 Merge branch 'next' into bp_random2 2016-03-31 21:44:03 -04:00
Alam Ed Arias b45b9801d6 Merge branch 'next' into slope-fixes 2016-03-31 21:43:51 -04:00
Inuyasha 816990a3ed Merge branch 'polyobj-teeter-fix' into 'next'
Fix for teetering on PolyObjects

So... somebody goofed and didn't realise PolyObject sectors could be added to the sector node list for each object (which is referenced by mobj->touching_sectorlist), via their linedefs if they are nearby the player (yes, PolyObject linedefs are special and get to move about the level). As it turns out, this allows even INTANGIBLE PolyObjects to make you teeter in a seemingly inexplicable way.

What is happening is that PolyObject sectors, when they are added to the mentioned lists, are then checked under normal sector teetering conditions - if the player is above the floorheight by 24 FUs, you're officially teetering unless stated otherwise. The actual PolyObject teetering code can't help you here if the conditions are right, especially if they're taller than 24 FU in height.

There are a number of things wrong with the teetering code in general that I'd like to sort eventually, but at least now teetering on PolyObjects is fixed at last ...right? Please check the branch out if you can to check this, obviously.

See merge request !54
2016-03-31 20:55:28 -04:00
Alam Ed Arias 6b9fd60f06 Merge branch 'next' into camera-fix 2016-03-31 12:28:31 -04:00
Alam Ed Arias 47bb95f5f5 Merge branch 'next' into polyobj-teeter-fix 2016-03-31 12:26:52 -04:00
Alam Ed Arias 32a950893e Merge branch 'next' into slope-fixes 2016-03-31 12:17:40 -04:00
Alam Ed Arias d77e541f29 Merge branch 'next' into bp_random2 2016-03-31 12:15:09 -04:00
Inuyasha 3812b6bc20 the abs() is necessary; force unsigned shift and signed result 2016-03-31 06:48:08 -07:00
Alam Ed Arias 283c64ee20 Merge branch 'next' into camera-fix 2016-03-30 20:49:44 -04:00
Alam Ed Arias d26c486c6d Merge branch 'next' into polyobj-teeter-fix 2016-03-30 20:42:33 -04:00
Alam Ed Arias 4370459166 Merge branch 'next' into slope-fixes 2016-03-30 20:41:33 -04:00
Alam Ed Arias a935ac21e8 Merge branch 'next' into bp_random2 2016-03-30 20:40:48 -04:00
Alam Ed Arias 75f65c4d44 using abs() on unsigned have no effect 2016-03-30 20:17:09 -04:00
Alam Ed Arias 51aa7692d8 Merge branch 'master' into next 2016-03-30 20:15:08 -04:00
Alam Ed Arias b169529dfd switich to do the angle math in signed, then run it thur abs() 2016-03-30 11:47:27 -04:00
Alam Ed Arias 0fe6ee5339 cleanup abs warnings 2016-03-30 00:22:12 -04:00
Inuyasha ac03ce39c8 *_Random is now *_RandomByte.
P_RandomChance is now a macro for something that should happen a
certain percentage of time.

P_SignedRandom was moved to a macro. Nobody cared.

# Conflicts:
#	src/p_inter.c
2016-03-29 16:27:55 -07:00
Alam Ed Arias 42aa41c552 Merge branch 'next' into polyobj-teeter-fix 2016-03-25 18:44:30 -04:00
Monster Iestyn 13f4ef2f34 Merge branch 'next' of http://git.magicalgirl.moe/STJr/SRB2.git into slope-fixes 2016-03-12 23:06:37 +00:00
Monster Iestyn 5b89164cf7 Fix camera going nuts around intangible polyobjects 2016-03-10 20:50:54 +00:00
Inuyasha 6aa708b5af I don't think we need the BLUE_SPHERES define anymore... 2016-03-09 00:49:35 -08:00
Alam Ed Arias 407bf4f39d Merge branch 'next' into polyobj-teeter-fix 2016-03-07 16:46:32 -05:00
Alam Ed Arias 55a6355e15 Merge branch 'next' into slope-fixes 2016-03-07 16:45:51 -05:00
Inuyasha a8bca89dbd Merge branch 'backport_unslot-music' into 'next'
BACKPORT: removal of music slots

Relevant commits cherry-picked. Basically everything except the internal music track name switches.

See merge request !43
2016-03-03 22:31:21 -05:00
Inuyasha fc35c8557e Super color code cleaning, speed 50%, nothing special 2016-02-29 01:18:33 -08:00
Monster Iestyn 4b447b3d0d Don't add polyobjects to a mobj's sector nodes list. This causes the player to teeter whenever they are above the polyobject's bottom, whether or not it is solid
Also, a minor tweak for the teetering code itself, though it looks a right mess and probably should be redone in the future
2016-02-28 18:30:29 +00:00
Alam Ed Arias 2b12e5ff20 Merge branch 'next' into backport_unslot-music 2016-02-26 02:11:29 -05:00
Alam Ed Arias 07d331676b Merge branch 'next' into slope-fixes 2016-02-26 02:09:03 -05:00