- Sync scripting branch with what was in trunk on Sunday. I believe that would be revision 2739.
SVN r2790 (scripting)
This commit is contained in:
commit
99670b708c
317 changed files with 17299 additions and 7273 deletions
|
|
@ -601,7 +601,7 @@ void GiveSpawner (player_t *player, PClassInventory *type, int amount)
|
|||
|
||||
void cht_Give (player_t *player, const char *name, int amount)
|
||||
{
|
||||
bool giveall;
|
||||
enum { ALL_NO, ALL_YES, ALL_YESYES } giveall;
|
||||
int i;
|
||||
PClassActor *type;
|
||||
|
||||
|
|
@ -613,9 +613,17 @@ void cht_Give (player_t *player, const char *name, int amount)
|
|||
return;
|
||||
}
|
||||
|
||||
giveall = (stricmp (name, "all") == 0);
|
||||
giveall = ALL_NO;
|
||||
if (stricmp (name, "all") == 0)
|
||||
{
|
||||
giveall = ALL_YES;
|
||||
}
|
||||
else if (stricmp (name, "everything") == 0)
|
||||
{
|
||||
giveall = ALL_YESYES;
|
||||
}
|
||||
|
||||
if (giveall || stricmp (name, "health") == 0)
|
||||
if (stricmp (name, "health") == 0)
|
||||
{
|
||||
if (amount > 0)
|
||||
{
|
||||
|
|
@ -640,9 +648,6 @@ void cht_Give (player_t *player, const char *name, int amount)
|
|||
player->health = deh.GodHealth;
|
||||
}
|
||||
}
|
||||
|
||||
if (!giveall)
|
||||
return;
|
||||
}
|
||||
|
||||
if (giveall || stricmp (name, "backpack") == 0)
|
||||
|
|
@ -757,7 +762,7 @@ void cht_Give (player_t *player, const char *name, int amount)
|
|||
player->weapons.LocateWeapon(static_cast<PClassWeapon *>(type), NULL, NULL))
|
||||
{
|
||||
AWeapon *def = (AWeapon*)GetDefaultByType (type);
|
||||
if (!(def->WeaponFlags & WIF_CHEATNOTWEAPON))
|
||||
if (giveall == ALL_YESYES || !(def->WeaponFlags & WIF_CHEATNOTWEAPON))
|
||||
{
|
||||
GiveSpawner (player, static_cast<PClassInventory *>(type), 1);
|
||||
}
|
||||
|
|
@ -783,7 +788,7 @@ void cht_Give (player_t *player, const char *name, int amount)
|
|||
!type->IsDescendantOf (RUNTIME_CLASS(APowerup)) &&
|
||||
!type->IsDescendantOf (RUNTIME_CLASS(AArmor)))
|
||||
{
|
||||
GiveSpawner (player, static_cast<PClassInventory *>(type), 1);
|
||||
GiveSpawner (player, static_cast<PClassInventory *>(type), amount <= 0 ? def->MaxAmount : amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -801,7 +806,7 @@ void cht_Give (player_t *player, const char *name, int amount)
|
|||
AInventory *def = (AInventory*)GetDefaultByType (type);
|
||||
if (def->Icon.isValid())
|
||||
{
|
||||
GiveSpawner (player, static_cast<PClassInventory *>(type), 1);
|
||||
GiveSpawner (player, static_cast<PClassInventory *>(type), amount <= 0 ? def->MaxAmount : amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1063,7 +1068,6 @@ void cht_Suicide (player_t *plyr)
|
|||
}
|
||||
}
|
||||
|
||||
bool CheckCheatmode ();
|
||||
|
||||
CCMD (mdk)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue