- Added the MF2_PASSMOBJ for P_Thing_Spawn() from January 4, 2003, to
DLevelScript::DoSpawn(). - Changed VectorNormalize() (and VectorNormalize2) to use doubles for storing the vector lengths, fixing desyncs between GCC/VC++ games that happened because the two compilers produced slightly different results for some slopes. GCC kept them in registers, so they were never truncated to floats. VC++ stored them to memory and reloaded them in order to truncate them to the defined precision. Lesson learned: Floating point numbers in local variables should always be doubles to produce the best code with VC++ that has the best chance of matching GCC's default behavior. - Removed netget and netsend function pointers. PacketGet and PacketSend are now called directly. - Fixed: Watching a demo from the point of view of someone other than the first player could cause a crash when the demo ended. - Removed invcount from the expression evaluator at Grubber's suggestion, because it doesn't work. - Fixed: vid_nowidescreen should fire off setsizeneeded so that changes to it can happen immediately instead of at the next resolution change. SVN r355 (trunk)
This commit is contained in:
parent
7c1fbe7ee5
commit
35ca16ba4f
8 changed files with 47 additions and 61 deletions
|
|
@ -88,7 +88,6 @@ enum ExpOp
|
|||
EX_Random, // random (min, max)
|
||||
EX_Sin, // sin (angle)
|
||||
EX_Cos, // cos (angle)
|
||||
EX_InvCount, // invcount (type)
|
||||
EX_ActionSpecial,
|
||||
EX_Right,
|
||||
};
|
||||
|
|
@ -264,10 +263,7 @@ struct ExpData
|
|||
{
|
||||
if (Children[i])
|
||||
{
|
||||
if (Type == EX_InvCount)
|
||||
free (Children[i]);
|
||||
else
|
||||
delete Children[i];
|
||||
delete Children[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -307,7 +303,7 @@ struct ExpData
|
|||
delete data;
|
||||
}
|
||||
}
|
||||
else if (Type != EX_Random && Type != EX_Sin && Type != EX_Cos && Type != EX_InvCount && Type != EX_ActionSpecial)
|
||||
else if (Type != EX_Random && Type != EX_Sin && Type != EX_Cos && Type != EX_ActionSpecial)
|
||||
{
|
||||
if (Children[0]->Type == EX_Const && Children[1]->Type == EX_Const)
|
||||
{
|
||||
|
|
@ -751,22 +747,6 @@ static ExpData *ParseExpressionA ()
|
|||
|
||||
return data;
|
||||
}
|
||||
else if (SC_CheckString ("invcount"))
|
||||
{
|
||||
if (!SC_CheckString ("("))
|
||||
SC_ScriptError ("'(' expected");
|
||||
|
||||
ExpData *data = new ExpData;
|
||||
data->Type = EX_InvCount;
|
||||
|
||||
SC_MustGetString ();
|
||||
data->Children[0] = (ExpData *)strdup (sc_String);
|
||||
|
||||
if (!SC_CheckString (")"))
|
||||
SC_ScriptError ("')' expected");
|
||||
|
||||
return data;
|
||||
}
|
||||
else if (SC_CheckNumber ())
|
||||
{
|
||||
ExpData *data = new ExpData;
|
||||
|
|
@ -1473,24 +1453,6 @@ static ExpVal EvalExpression (ExpData *data, AActor *self)
|
|||
}
|
||||
break;
|
||||
|
||||
case EX_InvCount:
|
||||
{
|
||||
const char *name = (const char *)data->Children[0];
|
||||
const PClass *type = PClass::FindClass (name);
|
||||
|
||||
val.Type = VAL_Int;
|
||||
val.Int = 0;
|
||||
|
||||
if (!type)
|
||||
break;
|
||||
|
||||
AInventory *item = self->FindInventory (type);
|
||||
|
||||
if (item)
|
||||
val.Int = item->Amount;
|
||||
}
|
||||
break;
|
||||
|
||||
case EX_ActionSpecial:
|
||||
{
|
||||
int parms[5] = { 0, 0, 0, 0 };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue