Bug Tracker – Attachment #247: Emulate vanilla doom's switch sound behavior, R1 for bug #619

View | Details | Raw Unified | Return to bug 619
Collapse All | Expand All

(-)common/p_switch.cpp (-3 / +30 lines)
 Lines 37-42    Link Here 
37
#include "w_wad.h"
37
#include "w_wad.h"
38
#include "gi.h"
38
#include "gi.h"
39
39
40
EXTERN_CVAR(co_vanillaswitches)
41
40
//
42
//
41
// CHANGE THE TEXTURE OF A WALL SWITCH TO ITS OPPOSITE
43
// CHANGE THE TEXTURE OF A WALL SWITCH TO ITS OPPOSITE
42
//
44
//
 Lines 240-246    Link Here 
240
			//		facing a big sector.
242
			//		facing a big sector.
241
			fixed_t x = line->v1->x + (line->dx >> 1);
243
			fixed_t x = line->v1->x + (line->dx >> 1);
242
			fixed_t y = line->v1->y + (line->dy >> 1);
244
			fixed_t y = line->v1->y + (line->dy >> 1);
243
			S_Sound (x, y, CHAN_VOICE, sound, 1, ATTN_STATIC);
245
246
			if (co_vanillaswitches)
247
			{
248
				// [SL] 2011-05-16 - Reverted the code to play the sound at full
249
				// volume anywhere on the map to emulate vanilla doom behavior
250
				S_Sound (CHAN_BODY, sound, 1, ATTN_NONE);
251
			}
252
			else
253
			{
254
				// Classic Odamex switch behavior
255
				S_Sound (x, y, CHAN_VOICE, sound, 1, ATTN_STATIC);
256
			}
257
				
244
			*texture = (short)switchlist[i^1];
258
			*texture = (short)switchlist[i^1];
245
			if (useAgain)
259
			if (useAgain)
246
				P_StartButton (line, where, switchlist[i], BUTTONTIME, x, y);
260
				P_StartButton (line, where, switchlist[i], BUTTONTIME, x, y);
 Lines 306-313    Link Here 
306
		default:
320
		default:
307
			break;
321
			break;
308
		}
322
		}
309
		
323
	
310
		S_Sound (m_X, m_Y, CHAN_VOICE, "switches/normbutn", 1, ATTN_STATIC);
324
		if (co_vanillaswitches)
325
		{
326
			// [SL] 2011-05-18 - Changed to play the switch resetting sound at the
327
			// map location 0,0 to emulate the bug in vanilla doom
328
			static fixed_t map_origin[2];
329
			map_origin[0] = 0;
330
			map_origin[1] = 0;
331
			S_Sound (map_origin, CHAN_BODY, "switches/normbutn", 1, ATTN_NORM);
332
		}
333
		else
334
		{
335
			// Classic Odamex switch behavior
336
			S_Sound (m_X, m_Y, CHAN_VOICE, "switches/normbutn", 1, ATTN_STATIC);
337
		}
311
		Destroy ();
338
		Destroy ();
312
	}
339
	}
313
}
340
}
(-)common/c_cvarlist.cpp (+3 lines)
 Lines 92-97    Link Here 
92
// Enable/disable zdoom-based gravity and physics interactions
92
// Enable/disable zdoom-based gravity and physics interactions
93
CVAR (co_zdoomphys, "0", CVAR_ARCHIVE | CVAR_SERVERARCHIVE | CVAR_SERVERINFO)
93
CVAR (co_zdoomphys, "0", CVAR_ARCHIVE | CVAR_SERVERARCHIVE | CVAR_SERVERINFO)
94
94
95
// Play the switch resetting sound at map location (0,0) like the vanilla bug
96
CVAR (co_vanillaswitches, "1", CVAR_SERVERINFO)
97
95
CVAR_FUNC_DECL (sv_gravity, "800", CVAR_ARCHIVE | CVAR_SERVERARCHIVE | CVAR_SERVERINFO)
98
CVAR_FUNC_DECL (sv_gravity, "800", CVAR_ARCHIVE | CVAR_SERVERARCHIVE | CVAR_SERVERINFO)
96
CVAR_FUNC_DECL (sv_aircontrol, "0.00390625", CVAR_ARCHIVE | CVAR_SERVERARCHIVE | CVAR_SERVERINFO | CVAR_NOENABLEDISABLE)
99
CVAR_FUNC_DECL (sv_aircontrol, "0.00390625", CVAR_ARCHIVE | CVAR_SERVERARCHIVE | CVAR_SERVERINFO | CVAR_NOENABLEDISABLE)
97
100

Return to bug 619