- fixed: Map wads with less than 4 lumps caused an endless loop in the gl nodes checking code.

This condition is true for all UDMF maps with only a TEXTMAP lump.

Update to ZDoom r1523:

- Fixed: The UDMF textmap readbuffer was never freed.
- Fixed: GetPlayerInput() died if you tried to get the input of the activator
  and the activator was the world.
- fixed: Any player class inheriting directly from PlayerPawn was left with
  empty weapon slots due to the recent rewrite of the weapon slot assignment
  code. To handle such classes each game now defines a default weapon slot
  setting in its gameinfo. This will be used when a player class without any
  weapon slot settings is used.
- added 'damage' to the actor variables exported to DECORATE's expression
  evaluator.
- fixed: solid corpses could block ripper missile that originally killed them.
- Fixed: Doom's status bar was lacking its default face.
- Fixed: Custom skin face graphics were not added to the texture manager.
- Fixed: UseHealthItems() gave you health equal to the number of items in
  the stack of health items, rather than the item's proper amount.
- Fixed: SBARINFO's "usessecondaryammo" considered a weapon to not use
  secondaryammo if ammo2's type was the same as ammo1's, but only if you
  didn't use the "not" keyword with it.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@321 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
Christoph Oelckers 2009-04-06 17:27:59 +00:00
parent bc99651e12
commit 4c1cbcedfa
22 changed files with 161 additions and 17 deletions

View file

@ -1,4 +1,32 @@
March 29, 2009 (Changes by Graf Zahl)
April 6, 2009 (Changes by Graf Zahl)
- Fixed: The UDMF textmap readbuffer was never freed.
April 4, 2009
- Fixed: GetPlayerInput() died if you tried to get the input of the activator
and the activator was the world.
April 4, 2009 (Changes by Graf Zahl)
- fixed: Any player class inheriting directly from PlayerPawn was left with
empty weapon slots due to the recent rewrite of the weapon slot assignment
code. To handle such classes each game now defines a default weapon slot
setting in its gameinfo. This will be used when a player class without any
weapon slot settings is used.
- added 'damage' to the actor variables exported to DECORATE's expression
evaluator.
- fixed: solid corpses could block ripper missile that originally killed them.
April 2, 2009
- Fixed: Doom's status bar was lacking its default face.
- Fixed: Custom skin face graphics were not added to the texture manager.
- Fixed: UseHealthItems() gave you health equal to the number of items in
the stack of health items, rather than the item's proper amount.
April 1, 2008
- Fixed: SBARINFO's "usessecondaryammo" considered a weapon to not use
secondaryammo if ammo2's type was the same as ammo1's, but only if you
didn't use the "not" keyword with it.
March 29, 2009 (Changes by Graf Zahl)
- Fixed: Altering a link type with Sector_SetLink did not work.
- Fixed: player.crouchsprite had no proper means of unsetting the crouch
sprite which is needed by the ChexPlayer.

View file

@ -328,34 +328,37 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition)
_y = self->SpawnPoint[1];
sec = P_PointInSector (_x, _y);
self->SetOrigin (_x, _y, sec->floorplane.ZatPoint (_x, _y));
P_CheckPosition (self, _x, _y);
fixed_t floorz = sec->floorplane.ZatPoint (_x, _y);
fixed_t ceilingz = sec->ceilingplane.ZatPoint (_x, _y);
self->SetOrigin (_x, _y, floorz);
if (self->flags & MF_SPAWNCEILING)
{
self->z = self->ceilingz - self->height - self->SpawnPoint[2];
self->z = ceilingz - self->height - self->SpawnPoint[2];
}
else if (self->flags2 & MF2_SPAWNFLOAT)
{
fixed_t space = self->ceilingz - self->height - self->floorz;
fixed_t space = ceilingz - self->height - floorz;
if (space > 48*FRACUNIT)
{
space -= 40*FRACUNIT;
self->z = ((space * pr_restore())>>8) + self->floorz + 40*FRACUNIT;
self->z = ((space * pr_restore())>>8) + floorz + 40*FRACUNIT;
}
else
{
self->z = self->floorz;
self->z = floorz;
}
}
else
{
self->z = self->SpawnPoint[2] + self->floorz;
self->z = self->SpawnPoint[2] + floorz;
if (self->flags2 & MF2_FLOATBOB)
{
self->z += FloatBobOffsets[(self->FloatBobPhase + level.maptime) & 63];
}
}
P_CheckPosition (self, _x, _y);
}
int AInventory::StaticLastMessageTic;

View file

@ -73,6 +73,7 @@ struct FWeaponSlots
bool LocateWeapon (const PClass *type, int *const slot, int *const index);
ESlotDef AddDefaultWeapon (int slot, const PClass *type);
void AddExtraWeapons();
void SetFromGameInfo();
void SetFromPlayer(const PClass *type);
void StandardSetup(const PClass *type);
void LocalSetup(const PClass *type);

View file

@ -1115,6 +1115,44 @@ void FWeaponSlots::AddExtraWeapons()
}
}
//===========================================================================
//
// FWeaponSlots :: SetFromGameInfo
//
// If neither the player class nor any defined weapon contain a
// slot assignment, use the game's defaults
//
//===========================================================================
void FWeaponSlots::SetFromGameInfo()
{
unsigned int i;
// Only if all slots are empty
for (i = 0; i < NUM_WEAPON_SLOTS; ++i)
{
if (Slots[i].Size() > 0) return;
}
// Append extra weapons to the slots.
for (i = 0; i < NUM_WEAPON_SLOTS; ++i)
{
for (unsigned j = 0; j < gameinfo.DefaultWeaponSlots[i].Size(); i++)
{
const PClass *cls = PClass::FindClass(gameinfo.DefaultWeaponSlots[i][j]);
if (cls == NULL)
{
Printf("Unknown weapon class '%s' found in default weapon slot assignments\n",
gameinfo.DefaultWeaponSlots[i][j].GetChars());
}
else
{
Slots[i].AddWeapon(cls);
}
}
}
}
//===========================================================================
//
// FWeaponSlots :: StandardSetup
@ -1122,6 +1160,7 @@ void FWeaponSlots::AddExtraWeapons()
// Setup weapons in this order:
// 1. Use slots from player class.
// 2. Add extra weapons that specify their own slots.
// 3. If all slots are empty, use the settings from the gameinfo (compatibility fallback)
//
//===========================================================================
@ -1129,6 +1168,7 @@ void FWeaponSlots::StandardSetup(const PClass *type)
{
SetFromPlayer(type);
AddExtraWeapons();
SetFromGameInfo();
}
//===========================================================================

View file

@ -1288,7 +1288,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
break;
case SBARINFO_USESSECONDARYAMMO:
if((CPlayer->ReadyWeapon != NULL && CPlayer->ReadyWeapon->AmmoType2 != NULL && CPlayer->ReadyWeapon->AmmoType2 != CPlayer->ReadyWeapon->AmmoType1 && !(cmd.flags & SBARINFOEVENT_NOT)) ||
((CPlayer->ReadyWeapon == NULL || CPlayer->ReadyWeapon->AmmoType2 == NULL) && cmd.flags & SBARINFOEVENT_NOT))
((CPlayer->ReadyWeapon == NULL || CPlayer->ReadyWeapon->AmmoType2 == NULL || CPlayer->ReadyWeapon->AmmoType2 == CPlayer->ReadyWeapon->AmmoType1) && cmd.flags & SBARINFOEVENT_NOT))
{
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
}

View file

@ -175,7 +175,26 @@ void FMapInfoParser::ParseGameInfo()
FString nextKey = sc.String;
sc.MustGetToken('=');
if(nextKey.CompareNoCase("border") == 0)
if (nextKey.CompareNoCase("weaponslot") == 0)
{
sc.MustGetToken(TK_IntConst);
if (sc.Number < 0 || sc.Number >= 10)
{
sc.ScriptError("Weapon slot index must be in range [0..9].\n");
}
int i = sc.Number;
gameinfo.DefaultWeaponSlots[i].Clear();
sc.MustGetToken(',');
do
{
sc.MustGetString();
FName val = sc.String;
gameinfo.DefaultWeaponSlots[i].Push(val);
}
while (sc.CheckToken(','));
}
else if(nextKey.CompareNoCase("border") == 0)
{
if(sc.CheckToken(TK_Identifier))
{

View file

@ -72,6 +72,7 @@ struct gameinfo_t
TArray<FName> creditPages;
TArray<FName> finalePages;
TArray<FName> infoPages;
TArray<FName> DefaultWeaponSlots[10];
FString titleMusic;
float titleTime;

View file

@ -781,7 +781,7 @@ static int FindGLNodesInFile(FileReader * f, const char * label)
f->Seek(0, SEEK_SET);
(*f) >> id >> numentries >> dirofs;
if (id == IWAD_ID || id == PWAD_ID)
if ((id == IWAD_ID || id == PWAD_ID) && numentries > 4)
{
f->Seek(dirofs, SEEK_SET);
for(DWORD i=0;i<numentries-4;i++)

View file

@ -2648,6 +2648,10 @@ int DLevelScript::GetPlayerInput(int playernum, int inputnum)
if (playernum < 0)
{
if (activator == NULL)
{
return 0;
}
p = activator->player;
}
else if (playernum >= MAXPLAYERS || !playeringame[playernum])

View file

@ -744,11 +744,11 @@ static int UseHealthItems(TArray<AInventory *> &Items, int &saveHealth)
if (Items[i]->health > maxhealth)
{
index = i;
maxhealth = Items[i]->Amount;
maxhealth = Items[i]->health;
}
}
// Now apply the health items, using the same logic as Heretic anf Hexen.
// Now apply the health items, using the same logic as Heretic and Hexen.
int count = (saveHealth + maxhealth-1) / maxhealth;
for(int i = 0; i < count; i++)
{

View file

@ -834,6 +834,11 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
{
return true;
}
// Check for rippers passing through corpses
if ((thing->flags & MF_CORPSE) && (tm.thing->flags2 & MF2_RIP) && !(thing->flags & MF_SHOOTABLE))
{
return true;
}
int clipheight;

View file

@ -1107,6 +1107,7 @@ struct UDMFParser
map->Read(ML_TEXTMAP, buffer);
sc.OpenMem(Wads.GetLumpFullName(map->lumpnum), buffer, map->Size(ML_TEXTMAP));
delete [] buffer;
sc.SetCMode(true);
if (sc.CheckString("namespace"))
{
@ -1232,7 +1233,6 @@ struct UDMFParser
// Create the real linedefs and decompress the sidedefs
ProcessLineDefs();
}
};

View file

@ -3,5 +3,5 @@
// This file was automatically generated by the
// updaterevision tool. Do not edit by hand.
#define ZD_SVN_REVISION_STRING "1514"
#define ZD_SVN_REVISION_NUMBER 1514
#define ZD_SVN_REVISION_STRING "1523"
#define ZD_SVN_REVISION_NUMBER 1523

View file

@ -72,6 +72,7 @@ DEFINE_MEMBER_VARIABLE(z, AActor)
DEFINE_MEMBER_VARIABLE(momx, AActor)
DEFINE_MEMBER_VARIABLE(momy, AActor)
DEFINE_MEMBER_VARIABLE(momz, AActor)
DEFINE_MEMBER_VARIABLE(Damage, AActor)
//==========================================================================
//

View file

@ -63,6 +63,14 @@ void FImageCollection::Add (const char **patchNames, int numPatches, int namespc
for (int i = 0; i < numPatches; ++i)
{
FTextureID picnum = TexMan.CheckForTexture(patchNames[i], namespc);
if (!picnum.isValid())
{
int lumpnum = Wads.CheckNumForName(patchNames[i], namespc);
if (lumpnum >= 0)
{
picnum = TexMan.CreateTexture(lumpnum, namespc);
}
}
ImageMap[OldCount + i] = picnum;
}
}

View file

@ -33,6 +33,7 @@ ACTOR Actor native //: Thinker
native int tid;
native int TIDtoHate;
native int waterlevel;
native int damage;
native fixed_t x;
native fixed_t y;
native fixed_t z;

View file

@ -25,6 +25,13 @@ gameinfo
backpacktype = "ZorchPack"
statusbar = "sbarinfo/doom.txt"
intermissionmusic = "$MUSIC_INTER"
weaponslot = 1, "Bootspoon", "SuperBootspork"
weaponslot = 2, "MiniZorcher"
weaponslot = 3, "LargeZorcher", "SuperLargeZorcher"
weaponslot = 4, "RapidZorcher"
weaponslot = 5, "ZorchPropulsor"
weaponslot = 6, "PhasingZorcher"
weaponslot = 7, "LAZDevice"
}
skill baby

View file

@ -25,6 +25,13 @@ gameinfo
backpacktype = "Backpack"
statusbar = "sbarinfo/doom.txt"
intermissionmusic = "$MUSIC_DM2INT"
weaponslot = 1, "Fist", "Chainsaw"
weaponslot = 2, "Pistol"
weaponslot = 3, "Shotgun", "SuperShotgun"
weaponslot = 4, "Chaingun"
weaponslot = 5, "RocketLauncher"
weaponslot = 6, "PlasmaRifle"
weaponslot = 7, "BFG9000"
}
skill baby

View file

@ -25,6 +25,13 @@ gameinfo
backpacktype = "BagOfHolding"
statusbar = ""
intermissionmusic = "mus_intr"
weaponslot = 1, "Staff", "Gauntlets"
weaponslot = 2, "GoldWand"
weaponslot = 3, "Crossbow"
weaponslot = 4, "Blaster"
weaponslot = 5, "SkullRod"
weaponslot = 6, "PhoenixRod"
weaponslot = 7, "Mace"
}
skill baby

View file

@ -28,6 +28,10 @@ gameinfo
backpacktype = "BagOfHolding" // Hexen doesn't have a backpack so use Heretic's.
statusbar = ""
intermissionmusic = "hub"
weaponslot = 1, "FWeapFist", "CWeapMace", "MWeapWand"
weaponslot = 2, "FWeapAxe", "CWeapStaff", "MWeapFrost"
weaponslot = 3, "FWeapHammer", "CWeapFlame", "MWeapLightning"
weaponslot = 4, "FWeapQuietus", "CWeapWraithverge", "MWeapBloodscourge"
}
skill baby

View file

@ -25,6 +25,14 @@ gameinfo
backpacktype = "AmmoSatchel"
statusbar = ""
intermissionmusic = "d_slide"
weaponslot = 1, "PunchDagger"
weaponslot = 2, "StrifeCrossbow2", "StrifeCrossbow"
weaponslot = 3, "AssaultGun"
weaponslot = 4, "MiniMissileLauncher"
weaponslot = 5, "StrifeGrenadeLauncher2", "StrifeGrenadeLauncher"
weaponslot = 6, "FlameThrower"
weaponslot = 7, "Mauler2", "Mauler"
weaponslot = 8, "Sigil"
}
skill baby

View file

@ -110,7 +110,7 @@ statusbar normal // Standard Doom Status bar
}
drawselectedinventory alternateonempty, INDEXFONT, 143, 168
{
drawmugshot 5, 143, 168;
drawmugshot "STF", 5, 143, 168;
}
}