mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-05-30 17:00:48 +00:00
* Updated to ZDoom r3889:
- Moved Sqrt, FixedSqrt, and VectorLength to ACSF_ instead of adding new opcodes. - Fixed: WeaponGiver needs to set the MF_DROPPED flag of the spawned weapon to match its own. - Fixed: WeaponGiver should not remember the given weapon after it is picked up. - Added the Inventory flag IF_NEVERRESPAWN. - Added sqrt, fixedsqrt, and vectorlength to ACS. - Fixed: FString::Insert copied too many characters. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1457 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
543f33259a
commit
b62c6a09df
8 changed files with 25 additions and 5 deletions
|
@ -498,6 +498,7 @@ bool AInventory::SpecialDropAction (AActor *dropper)
|
|||
bool AInventory::ShouldRespawn ()
|
||||
{
|
||||
if ((ItemFlags & IF_BIGPOWERUP) && !(dmflags & DF_RESPAWN_SUPER)) return false;
|
||||
if (ItemFlags & IF_NEVERRESPAWN) return false;
|
||||
return !!(dmflags & DF_ITEMS_RESPAWN);
|
||||
}
|
||||
|
||||
|
|
|
@ -132,6 +132,7 @@ enum
|
|||
IF_NOATTENPICKUPSOUND = 1<<17, // Play pickup sound with ATTN_NONE
|
||||
IF_PERSISTENTPOWER = 1<<18, // Powerup is kept when travelling between levels
|
||||
IF_RESTRICTABSOLUTELY = 1<<19, // RestrictedTo and ForbiddenTo do not allow pickup in any form by other classes
|
||||
IF_NEVERRESPAWN = 1<<20, // Never, ever respawns
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -727,6 +727,7 @@ bool AWeaponGiver::TryPickup(AActor *&toucher)
|
|||
if (weap != NULL)
|
||||
{
|
||||
weap->ItemFlags &= ~IF_ALWAYSPICKUP; // use the flag of this item only.
|
||||
weap->flags = (weap->flags & ~MF_DROPPED) | (this->flags & MF_DROPPED);
|
||||
if (AmmoGive1 >= 0) weap->AmmoGive1 = AmmoGive1;
|
||||
if (AmmoGive2 >= 0) weap->AmmoGive2 = AmmoGive2;
|
||||
weap->BecomeItem();
|
||||
|
@ -736,7 +737,11 @@ bool AWeaponGiver::TryPickup(AActor *&toucher)
|
|||
|
||||
weap = barrier_cast<AWeapon*>(master);
|
||||
bool res = weap->CallTryPickup(toucher);
|
||||
if (res) GoAwayAndDie();
|
||||
if (res)
|
||||
{
|
||||
GoAwayAndDie();
|
||||
master = NULL;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3377,6 +3377,9 @@ enum EACSFunctions
|
|||
ACSF_ACS_NamedExecuteAlways,
|
||||
ACSF_UniqueTID,
|
||||
ACSF_IsTIDUsed,
|
||||
ACSF_Sqrt,
|
||||
ACSF_FixedSqrt,
|
||||
ACSF_VectorLength,
|
||||
|
||||
// ZDaemon
|
||||
ACSF_GetTeamScore = 19620,
|
||||
|
@ -3901,6 +3904,15 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
|
|||
return P_IsTIDUsed(args[0]);
|
||||
break;
|
||||
|
||||
case ACSF_Sqrt:
|
||||
return xs_FloorToInt(sqrt(double(args[0])));
|
||||
|
||||
case ACSF_FixedSqrt:
|
||||
return FLOAT2FIXED(sqrt(FIXED2DBL(args[0])));
|
||||
|
||||
case ACSF_VectorLength:
|
||||
return FLOAT2FIXED(TVector2<double>(FIXED2DBL(args[0]), FIXED2DBL(args[1])).Length());
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -603,7 +603,7 @@ public:
|
|||
PCD_SCRIPTWAITNAMED,
|
||||
PCD_TRANSLATIONRANGE3,
|
||||
|
||||
/*361*/ PCODE_COMMAND_COUNT
|
||||
/*363*/ PCODE_COMMAND_COUNT
|
||||
};
|
||||
|
||||
// Some constants used by ACS scripts
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
// This file was automatically generated by the
|
||||
// updaterevision tool. Do not edit by hand.
|
||||
|
||||
#define ZD_SVN_REVISION_STRING "3881"
|
||||
#define ZD_SVN_REVISION_NUMBER 3881
|
||||
#define ZD_SVN_REVISION_STRING "3889"
|
||||
#define ZD_SVN_REVISION_NUMBER 3889
|
||||
|
|
|
@ -298,6 +298,7 @@ static FFlagDef InventoryFlags[] =
|
|||
DEFINE_FLAG(IF, NOATTENPICKUPSOUND, AInventory, ItemFlags),
|
||||
DEFINE_FLAG(IF, PERSISTENTPOWER, AInventory, ItemFlags),
|
||||
DEFINE_FLAG(IF, RESTRICTABSOLUTELY, AInventory, ItemFlags),
|
||||
DEFINE_FLAG(IF, NEVERRESPAWN, AInventory, ItemFlags),
|
||||
|
||||
DEFINE_DEPRECATED_FLAG(PICKUPFLASH),
|
||||
DEFINE_DEPRECATED_FLAG(INTERHUBSTRIP),
|
||||
|
|
|
@ -773,7 +773,7 @@ void FString::Insert (size_t index, const char *instr, size_t instrlen)
|
|||
AllocBuffer (mylen + instrlen);
|
||||
StrCopy (Chars, old->Chars(), index);
|
||||
StrCopy (Chars + index, instr, instrlen);
|
||||
StrCopy (Chars + index + instrlen, old->Chars() + index, mylen - index + 1);
|
||||
StrCopy (Chars + index + instrlen, old->Chars() + index, mylen - index);
|
||||
old->Release();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue