mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-18 23:52:02 +00:00
Added option to check the location for resizing, changing the return into a bool.
This commit is contained in:
parent
3023af8223
commit
1bcebb091a
2 changed files with 16 additions and 2 deletions
|
@ -6852,13 +6852,27 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetSize)
|
||||||
PARAM_SELF_PROLOGUE(AActor);
|
PARAM_SELF_PROLOGUE(AActor);
|
||||||
PARAM_FLOAT(newradius);
|
PARAM_FLOAT(newradius);
|
||||||
PARAM_FLOAT_DEF(newheight);
|
PARAM_FLOAT_DEF(newheight);
|
||||||
|
PARAM_BOOL_DEF(testpos);
|
||||||
|
|
||||||
if (newradius < 0.) newradius = self->radius;
|
if (newradius < 0.) newradius = self->radius;
|
||||||
if (newheight < 0.) newheight = self->Height;
|
if (newheight < 0.) newheight = self->Height;
|
||||||
|
|
||||||
|
double oldradius = self->radius;
|
||||||
|
double oldheight = self->Height;
|
||||||
|
|
||||||
self->UnlinkFromWorld();
|
self->UnlinkFromWorld();
|
||||||
self->radius = newradius;
|
self->radius = newradius;
|
||||||
self->Height = newheight;
|
self->Height = newheight;
|
||||||
self->LinkToWorld();
|
self->LinkToWorld();
|
||||||
return 0;
|
|
||||||
|
if (testpos && !P_TestMobjLocation(self))
|
||||||
|
{
|
||||||
|
self->UnlinkFromWorld();
|
||||||
|
self->radius = oldradius;
|
||||||
|
self->Height = oldheight;
|
||||||
|
self->LinkToWorld();
|
||||||
|
ACTION_RETURN_BOOL(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
ACTION_RETURN_BOOL(true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -793,7 +793,7 @@ class Actor : Thinker native
|
||||||
native bool A_CopySpriteFrame(int from, int to, int flags = 0);
|
native bool A_CopySpriteFrame(int from, int to, int flags = 0);
|
||||||
native bool A_SetVisibleRotation(double anglestart = 0, double angleend = 0, double pitchstart = 0, double pitchend = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
|
native bool A_SetVisibleRotation(double anglestart = 0, double angleend = 0, double pitchstart = 0, double pitchend = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||||
native void A_SetTranslation(name transname);
|
native void A_SetTranslation(name transname);
|
||||||
native void A_SetSize(double newradius, double newheight = -1);
|
native bool A_SetSize(double newradius, double newheight = -1, bool testpos = false);
|
||||||
|
|
||||||
native void A_RearrangePointers(int newtarget, int newmaster = AAPTR_DEFAULT, int newtracer = AAPTR_DEFAULT, int flags=0);
|
native void A_RearrangePointers(int newtarget, int newmaster = AAPTR_DEFAULT, int newtracer = AAPTR_DEFAULT, int flags=0);
|
||||||
native void A_TransferPointer(int ptr_source, int ptr_recepient, int sourcefield, int recepientfield=AAPTR_DEFAULT, int flags=0);
|
native void A_TransferPointer(int ptr_source, int ptr_recepient, int sourcefield, int recepientfield=AAPTR_DEFAULT, int flags=0);
|
||||||
|
|
Loading…
Reference in a new issue