ValveSoftware / source-sdk-2013

The 2013 edition of the Source SDK
https://developer.valvesoftware.com/wiki/SDK2013_GettingStarted
Other
3.73k stars 1.99k forks source link

func_rot_button with 'Starts locked' spawn flag not working on map spawn. #401

Open malortie opened 7 years ago

malortie commented 7 years ago

Since CRotButton::Spawn does not call it's base class spawn method, the spawnflag SF_BUTTON_LOCKED condition is never verified.

Once we add the missing conditional statement, the button starts locked, and remains unusable until InputUnlock is called:

if (HasSpawnFlags(SF_BUTTON_LOCKED))
{
    m_bLocked = true;
}

Map makers can still overcome this issue by calling Lock on map spawn, but I would recommend fixing instead this problem by adding the modified code provided in this pull request.