PSX DOOM and DOOM 64 total conversions for GZDoom, overhauled. This mod builds on the existing total conversions of PlayStation DOOM and DOOM 64 for GZDoom, PSX DOOM TC and DOOM 64 Retribution, to take advantage of the latest GZDoom versions and add many features that make them more faithful but were impossible to implement at their time of release. To achieve this, a large amount of the code has been adapted from GEC Master Edition (also known as DZDoom), while looking at the reverse engineered code and existing source ports of these games for reference. In addition to that, the mod is highly modular and contains many *optional* "enhancements" that deviate from the original experience. Depending on your preference, you can choose to play as close to vanilla as possible, or experiment and play with upscaled textures, PBR materials, flashy particle effects and other features that are common in other GZDoom mods.

Forum Thread
  Posts  
Weapon sway broken after loading a game (Games : Doom II : Mods : DOOM CE : Forum : Bug Reports, Feedback, Questions : Weapon sway broken after loading a game) Locked
Thread Options
Jun 29 2022 Anchor

As the thread title says, weapon sway is completely broken after loading a save. I uploaded a fix for it, but it hasn't been authorized for a few days now, so might as well get the bug fixed in the main release.

The problem is the event handler for the sway WorldLoaded function must inherit from StaticEventHandler, not EventHandler. You can change the source directly, but my fix was to have a new event handler just for sway:

extend class CEExtrasHandler
{
	void SwayWorldLoaded(WorldEvent e)
	{	
		return; //null this
	}
}

class SwayHandler : StaticEventHandler
{
	SwayManager sway;
	
	override void WorldLoaded(WorldEvent e)
	{
		ThinkerIterator it = ThinkerIterator.Create("SwayManager", Thinker.MAX_STATNUM);
		sway = SwayManager(it.Next());
		
		if (!sway)
		{
			sway = new("SwayManager");
			sway.ChangeStatNum(Thinker.MAX_STATNUM);
			
			for (uint i = 0; i < MAXPLAYERS; ++i)
			{
				if (!playerInGame[i]|| !players[i].mo)
					continue;
				
				sway.prevAngle[i]= players[i].mo.angle;
				sway.prevPitch[i]= players[i].mo.pitch;
				if (!players[i].ReadyWeapon)
				{
					sway.prevY[i]= WEAPONBOTTOM;
					continue;
				}
				
				let psp = players[i].GetPSPrite(PSP_WEAPON);
				sway.prevX[i]= psp.x;
				sway.prevY[i]= psp.y;
			}
		}
		
		sway.CheckCVars();
	}
}

Edited by: TwelveEyes

Jul 2 2022 Anchor

Thanks, I'll fix this for the next release. I missed it when I merged the event handlers into a single one.

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.