- Make the autosegs read-only.

- Derive PClass from dobject.cpp. This has one major ramification: Since the PClass
  is not allocated until runtime, you cannot initialize any static/global data
  structures with pointers to PClasses using RUNTIME_CLASS. Attempting to do so
  will just initialize with a NULL pointer. Instead, you can initialize using
  the address of the pointer returned by RUNTIME_CLASS and dereference that. By
  the time you have an opportunity to dereference it, it will no longer be NULL.
- Sync CmakeLists.txt.
- Random fixes for problems GCC spotted.

SVN r1852 (scripting)
This commit is contained in:
Randy Heit 2009-09-17 01:36:14 +00:00
commit 1eb7912bd8
35 changed files with 258 additions and 207 deletions

View file

@ -52,17 +52,17 @@
void cht_DoCheat (player_t *player, int cheat)
{
static const PClass *BeholdPowers[9] =
static const PClass *const *BeholdPowers[9] =
{
RUNTIME_CLASS(APowerInvulnerable),
RUNTIME_CLASS(APowerStrength),
RUNTIME_CLASS(APowerInvisibility),
RUNTIME_CLASS(APowerIronFeet),
&RUNTIME_CLASS(APowerInvulnerable),
&RUNTIME_CLASS(APowerStrength),
&RUNTIME_CLASS(APowerInvisibility),
&RUNTIME_CLASS(APowerIronFeet),
NULL, // MapRevealer
RUNTIME_CLASS(APowerLightAmp),
RUNTIME_CLASS(APowerShadow),
RUNTIME_CLASS(APowerMask),
RUNTIME_CLASS(APowerTargeter)
&RUNTIME_CLASS(APowerLightAmp),
&RUNTIME_CLASS(APowerShadow),
&RUNTIME_CLASS(APowerMask),
&RUNTIME_CLASS(APowerTargeter)
};
const PClass *type;
AInventory *item;
@ -248,12 +248,12 @@ void cht_DoCheat (player_t *player, int cheat)
}
else if (player->mo != NULL && player->health >= 0)
{
item = player->mo->FindInventory (BeholdPowers[i]);
item = player->mo->FindInventory (*BeholdPowers[i]);
if (item == NULL)
{
if (i != 0)
{
player->mo->GiveInventoryType (BeholdPowers[i]);
player->mo->GiveInventoryType (*BeholdPowers[i]);
if (cheat == CHT_BEHOLDS)
{
P_GiveBody (player->mo, -100);