mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- console code fixes from GZDoom.
This commit is contained in:
parent
4523ad5f7e
commit
2e8566c6eb
2 changed files with 14 additions and 17 deletions
|
@ -720,6 +720,7 @@ void C_SetDefaultKeys(const char* baseconfig)
|
|||
ReadBindings(lump, true);
|
||||
}
|
||||
|
||||
lastlump = 0;
|
||||
while ((lump = fileSystem.FindLump("DEFBINDS", &lastlump)) != -1)
|
||||
{
|
||||
ReadBindings(lump, false);
|
||||
|
|
|
@ -172,7 +172,7 @@ void FBaseCVar::SetGenericRep (UCVarValue value, ECVarType type)
|
|||
{
|
||||
return;
|
||||
}
|
||||
else if ((Flags & CVAR_LATCH) && callbacks && callbacks->MustLatch())
|
||||
if ((Flags & CVAR_LATCH) && callbacks && callbacks->MustLatch())
|
||||
{
|
||||
FLatchedValue latch;
|
||||
|
||||
|
@ -186,16 +186,14 @@ void FBaseCVar::SetGenericRep (UCVarValue value, ECVarType type)
|
|||
LatchedValues.Push (latch);
|
||||
|
||||
Flags &= ~CVAR_UNSAFECONTEXT;
|
||||
return;
|
||||
}
|
||||
else if ((Flags & CVAR_SERVERINFO) && callbacks && callbacks->SendServerInfoChange)
|
||||
if ((Flags & CVAR_SERVERINFO) && callbacks && callbacks->SendServerInfoChange)
|
||||
{
|
||||
callbacks->SendServerInfoChange (this, value, type);
|
||||
if (callbacks->SendServerInfoChange(this, value, type)) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ForceSet (value, type);
|
||||
}
|
||||
}
|
||||
|
||||
bool FBaseCVar::ToBool (UCVarValue value, ECVarType type)
|
||||
{
|
||||
|
@ -969,10 +967,8 @@ void FFlagCVar::DoSet (UCVarValue value, ECVarType type)
|
|||
// another flag might have made to the same cvar earlier in the script.
|
||||
if (ValueVar.GetFlags() && callbacks && callbacks->SendServerFlagChange)
|
||||
{
|
||||
callbacks->SendServerFlagChange(&ValueVar, BitNum, newval, false);
|
||||
if (callbacks->SendServerFlagChange(&ValueVar, BitNum, newval, false)) return;
|
||||
}
|
||||
else
|
||||
{
|
||||
int val = *ValueVar;
|
||||
if (newval)
|
||||
val |= BitVal;
|
||||
|
@ -980,7 +976,6 @@ void FFlagCVar::DoSet (UCVarValue value, ECVarType type)
|
|||
val &= ~BitVal;
|
||||
ValueVar = val;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Mask cvar implementation
|
||||
|
@ -1072,13 +1067,14 @@ void FMaskCVar::DoSet (UCVarValue value, ECVarType type)
|
|||
{
|
||||
if (BitVal & (1<<i))
|
||||
{
|
||||
callbacks->SendServerFlagChange (&ValueVar, i, !!(val & (1<<i)), silent);
|
||||
if (!callbacks->SendServerFlagChange(&ValueVar, i, !!(val & (1 << i)), silent)) goto fallback; // the failure case here is either always or never.
|
||||
silent = true; // only warn once if SendServerFlagChange needs to.
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fallback:
|
||||
int vval = *ValueVar;
|
||||
vval &= ~BitVal;
|
||||
vval |= val;
|
||||
|
|
Loading…
Reference in a new issue