Merge branch 'master' into asmjit

# Conflicts:
#	src/p_actionfunctions.cpp
This commit is contained in:
Christoph Oelckers 2018-11-18 21:08:16 +01:00
commit 8bc2d50ad2
6 changed files with 29 additions and 28 deletions

View File

@ -763,12 +763,12 @@ void HWDrawInfo::PrepareUpperGap(seg_t * seg)
CreateFloodPoly(&ws, vertices.first+4, ws.z2, fakebsector, true); CreateFloodPoly(&ws, vertices.first+4, ws.z2, fakebsector, true);
gl_floodrendernode *node = NewFloodRenderNode(); gl_floodrendernode *node = NewFloodRenderNode();
auto pNode = floodFloorSegs.CheckKey(fakebsector->sectornum); auto pNode = floodCeilingSegs.CheckKey(fakebsector->sectornum);
node->next = pNode? *pNode : nullptr; node->next = pNode? *pNode : nullptr;
node->seg = seg; node->seg = seg;
node->vertexindex = vertices.second; node->vertexindex = vertices.second;
floodFloorSegs[fakebsector->sectornum] = node; floodCeilingSegs[fakebsector->sectornum] = node;
} }

View File

@ -4503,13 +4503,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_ChangeCountFlags)
return 0; return 0;
} }
enum ERaise
{
RF_TRANSFERFRIENDLINESS = 1,
RF_NOCHECKPOSITION = 2
};
//=========================================================================== //===========================================================================
// //
// A_RaiseMaster // A_RaiseMaster
@ -4520,10 +4513,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseMaster)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(flags); PARAM_INT(flags);
bool copy = !!(flags & RF_TRANSFERFRIENDLINESS);
if (self->master != NULL) if (self->master != NULL)
{ {
P_Thing_Raise(self->master, copy ? self : NULL, (flags & RF_NOCHECKPOSITION)); P_Thing_Raise(self->master, self, flags);
} }
return 0; return 0;
} }
@ -4541,12 +4533,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseChildren)
TThinkerIterator<AActor> it; TThinkerIterator<AActor> it;
AActor *mo; AActor *mo;
bool copy = !!(flags & RF_TRANSFERFRIENDLINESS);
while ((mo = it.Next()) != NULL) while ((mo = it.Next()) != NULL)
{ {
if (mo->master == self) if (mo->master == self)
{ {
P_Thing_Raise(mo, copy ? self : NULL, (flags & RF_NOCHECKPOSITION)); P_Thing_Raise(mo, self, flags);
} }
} }
return 0; return 0;
@ -4565,14 +4556,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseSiblings)
TThinkerIterator<AActor> it; TThinkerIterator<AActor> it;
AActor *mo; AActor *mo;
bool copy = !!(flags & RF_TRANSFERFRIENDLINESS);
if (self->master != NULL) if (self->master != NULL)
{ {
while ((mo = it.Next()) != NULL) while ((mo = it.Next()) != NULL)
{ {
if (mo->master == self->master && mo != self) if (mo->master == self->master && mo != self)
{ {
P_Thing_Raise(mo, copy ? self : NULL, (flags & RF_NOCHECKPOSITION)); P_Thing_Raise(mo, self, flags);
} }
} }
} }
@ -4588,7 +4578,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RaiseSelf)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(flags); PARAM_INT(flags);
ACTION_RETURN_BOOL(P_Thing_Raise(self, NULL, (flags & RF_NOCHECKPOSITION))); ACTION_RETURN_BOOL(P_Thing_Raise(self, self, flags));
} }
//=========================================================================== //===========================================================================
@ -4602,7 +4592,7 @@ DEFINE_ACTION_FUNCTION(AActor, RaiseActor)
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_OBJECT(other, AActor); PARAM_OBJECT(other, AActor);
PARAM_INT(flags); PARAM_INT(flags);
ACTION_RETURN_BOOL(P_Thing_Raise(other, self, (flags & RF_NOCHECKPOSITION))); ACTION_RETURN_BOOL(P_Thing_Raise(other, self, flags));
} }
//=========================================================================== //===========================================================================

View File

@ -1764,7 +1764,7 @@ FUNC(LS_Thing_Raise)
if (arg0==0) if (arg0==0)
{ {
ok = P_Thing_Raise (it,NULL, arg1); ok = P_Thing_Raise (it, it, arg1);
} }
else else
{ {
@ -1772,7 +1772,7 @@ FUNC(LS_Thing_Raise)
while ( (target = iterator.Next ()) ) while ( (target = iterator.Next ()) )
{ {
ok |= P_Thing_Raise(target,NULL, arg1); ok |= P_Thing_Raise(target, target, arg1);
} }
} }
return ok; return ok;

View File

@ -160,7 +160,7 @@ bool P_Thing_Move (int tid, AActor *source, int mapspot, bool fog);
int P_Thing_Damage (int tid, AActor *whofor0, int amount, FName type); int P_Thing_Damage (int tid, AActor *whofor0, int amount, FName type);
void P_Thing_SetVelocity(AActor *actor, const DVector3 &vec, bool add, bool setbob); void P_Thing_SetVelocity(AActor *actor, const DVector3 &vec, bool add, bool setbob);
void P_RemoveThing(AActor * actor); void P_RemoveThing(AActor * actor);
bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck = false); bool P_Thing_Raise(AActor *thing, AActor *raiser, int flags = 0);
bool P_Thing_CanRaise(AActor *thing); bool P_Thing_CanRaise(AActor *thing);
bool P_CanResurrect(AActor *ththing, AActor *thing); bool P_CanResurrect(AActor *ththing, AActor *thing);
PClassActor *P_GetSpawnableType(int spawnnum); PClassActor *P_GetSpawnableType(int spawnnum);
@ -475,4 +475,10 @@ enum ETexReplaceFlags
void P_ReplaceTextures(const char *fromname, const char *toname, int flags); void P_ReplaceTextures(const char *fromname, const char *toname, int flags);
enum ERaise
{
RF_TRANSFERFRIENDLINESS = 1,
RF_NOCHECKPOSITION = 2
};
#endif // __P_LOCAL__ #endif // __P_LOCAL__

View File

@ -432,7 +432,7 @@ void P_RemoveThing(AActor * actor)
} }
bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck) bool P_Thing_Raise(AActor *thing, AActor *raiser, int flags)
{ {
if (!thing) if (!thing)
return false; return false;
@ -455,7 +455,7 @@ bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck)
thing->flags |= MF_SOLID; thing->flags |= MF_SOLID;
thing->Height = info->Height; // [RH] Use real height thing->Height = info->Height; // [RH] Use real height
thing->radius = info->radius; // [RH] Use real radius thing->radius = info->radius; // [RH] Use real radius
if (!nocheck && !P_CheckPosition (thing, thing->Pos())) if (!(flags & RF_NOCHECKPOSITION) && !P_CheckPosition (thing, thing->Pos()))
{ {
thing->flags = oldflags; thing->flags = oldflags;
thing->radius = oldradius; thing->radius = oldradius;
@ -470,7 +470,7 @@ bool P_Thing_Raise(AActor *thing, AActor *raiser, int nocheck)
thing->Revive(); thing->Revive();
if (raiser != NULL) if ((flags & RF_TRANSFERFRIENDLINESS) && raiser != nullptr)
{ {
// Let's copy the friendliness of the one who raised it. // Let's copy the friendliness of the one who raised it.
thing->CopyFriendliness(raiser, false); thing->CopyFriendliness(raiser, false);

View File

@ -8140,12 +8140,17 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx)
} }
if (isDynArrayObj && ((MethodName == NAME_Push && idx == 0) || (MethodName == NAME_Insert && idx == 1))) if (isDynArrayObj && ((MethodName == NAME_Push && idx == 0) || (MethodName == NAME_Insert && idx == 1)))
{ {
// The DynArray_Obj declaration in dynarrays.txt doesn't support generics yet. Check the type here as if it did. // Null pointers are always valid.
if (!static_cast<PObjectPointer*>(elementType)->PointedClass()->IsAncestorOf(static_cast<PObjectPointer*>(a->ValueType)->PointedClass())) if (!a->isConstant() || static_cast<FxConstant*>(a)->GetValue().GetPointer() != nullptr)
{ {
ScriptPosition.Message(MSG_ERROR, "Type mismatch in function argument"); // The DynArray_Obj declaration in dynarrays.txt doesn't support generics yet. Check the type here as if it did.
delete this; if (!a->ValueType->isObjectPointer() ||
return nullptr; !static_cast<PObjectPointer*>(elementType)->PointedClass()->IsAncestorOf(static_cast<PObjectPointer*>(a->ValueType)->PointedClass()))
{
ScriptPosition.Message(MSG_ERROR, "Type mismatch in function argument");
delete this;
return nullptr;
}
} }
} }
if (a->IsDynamicArray()) if (a->IsDynamicArray())