From 980b68af1724bece9dceb146365260f09f79f3b7 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 12 Sep 2009 04:08:31 +0000 Subject: [PATCH] - Added warning messages when loading maps that have non-zero values in unused line argument fields, because these maps could potentially break in the future if the argument is later assigned a meaning. (Hopefully all the argument counts in actionspecials.h are accurate. I found a few that were wrong.) SVN r1817 (trunk) --- docs/rh-log.txt | 7 + src/actionspecials.h | 419 ++++++++++++------------ src/p_lnspec.cpp | 45 ++- src/p_lnspec.h | 13 +- src/p_spec.cpp | 20 +- zdoom.vcproj | 750 +++++++++++++++++++++---------------------- 6 files changed, 643 insertions(+), 611 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 835cc4d3d..acc611620 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,10 @@ +September 11, 2009 +- Added warning messages when loading maps that have non-zero values in + unused line argument fields, because these maps could potentially break + in the future if the argument is later assigned a meaning. (Hopefully + all the argument counts in actionspecials.h are accurate. I found a + few that were wrong.) + September 10, 2009 - Fixed: If a damaged actor has negative mass, it needs to have its damage thrust set to maximum instead of 0. See Action Doom's broken glass diff --git a/src/actionspecials.h b/src/actionspecials.h index d38a3c862..b185a7fa0 100644 --- a/src/actionspecials.h +++ b/src/actionspecials.h @@ -1,233 +1,234 @@ -DEFINE_SPECIAL(Polyobj_StartLine, 1, -1, -1) -DEFINE_SPECIAL(Polyobj_RotateLeft, 2, 3, 3) -DEFINE_SPECIAL(Polyobj_RotateRight, 3, 3, 3) -DEFINE_SPECIAL(Polyobj_Move, 4, 4, 4) -DEFINE_SPECIAL(Polyobj_ExplicitLine, 5, -1, -1) -DEFINE_SPECIAL(Polyobj_MoveTimes8, 6, 4, 4) -DEFINE_SPECIAL(Polyobj_DoorSwing, 7, 4, 4) -DEFINE_SPECIAL(Polyobj_DoorSlide, 8, 5, 5) -DEFINE_SPECIAL(Line_Horizon, 9, -1, 0) // [RH] draw one-sided wall at horizon -DEFINE_SPECIAL(Door_Close, 10, 2, 2) -DEFINE_SPECIAL(Door_Open, 11, 2, 3) -DEFINE_SPECIAL(Door_Raise, 12, 3, 4) -DEFINE_SPECIAL(Door_LockedRaise, 13, 4, 5) -DEFINE_SPECIAL(Door_Animated, 14, 3, 3) -DEFINE_SPECIAL(Autosave, 15, 0, 0) // [RH] Save the game *now* -DEFINE_SPECIAL(Transfer_WallLight, 16, -1, -1) -DEFINE_SPECIAL(Thing_Raise, 17, 1, 1) -DEFINE_SPECIAL(StartConversation, 18, 1, 2) -DEFINE_SPECIAL(Thing_Stop, 19, 1, 1) -DEFINE_SPECIAL(Floor_LowerByValue, 20, 3, 3) -DEFINE_SPECIAL(Floor_LowerToLowest, 21, 2, 2) -DEFINE_SPECIAL(Floor_LowerToNearest, 22, 2, 2) -DEFINE_SPECIAL(Floor_RaiseByValue, 23, 3, 3) -DEFINE_SPECIAL(Floor_RaiseToHighest, 24, 2, 2) -DEFINE_SPECIAL(Floor_RaiseToNearest, 25, 2, 2) -DEFINE_SPECIAL(Stairs_BuildDown, 26, 5, 5) -DEFINE_SPECIAL(Stairs_BuildUp, 27, 5, 5) -DEFINE_SPECIAL(Floor_RaiseAndCrush, 28, 3, 4) -DEFINE_SPECIAL(Pillar_Build, 29, 3, 3) -DEFINE_SPECIAL(Pillar_Open, 30, 4, 4) -DEFINE_SPECIAL(Stairs_BuildDownSync, 31, 4, 4) -DEFINE_SPECIAL(Stairs_BuildUpSync, 32, 4, 4) -DEFINE_SPECIAL(ForceField, 33, 0, 0) // [RH] Strife's forcefield special (148) -DEFINE_SPECIAL(ClearForceField, 34, 1, 1) // [RH] Remove Strife's forcefield from tagged sectors -DEFINE_SPECIAL(Floor_RaiseByValueTimes8, 35, 3, 3) -DEFINE_SPECIAL(Floor_LowerByValueTimes8, 36, 3, 3) -DEFINE_SPECIAL(Floor_MoveToValue, 37, 3, 4) -DEFINE_SPECIAL(Ceiling_Waggle, 38, 5, 5) // [RH] Complement of Floor_Waggle -DEFINE_SPECIAL(Teleport_ZombieChanger, 39, 2, 2) // [RH] Needed for Strife -DEFINE_SPECIAL(Ceiling_LowerByValue, 40, 3, 3) -DEFINE_SPECIAL(Ceiling_RaiseByValue, 41, 3, 3) -DEFINE_SPECIAL(Ceiling_CrushAndRaise, 42, 3, 4) -DEFINE_SPECIAL(Ceiling_LowerAndCrush, 43, 3, 4) -DEFINE_SPECIAL(Ceiling_CrushStop, 44, 1, 1) -DEFINE_SPECIAL(Ceiling_CrushRaiseAndStay, 45, 3, 4) -DEFINE_SPECIAL(Floor_CrushStop, 46, 1, 1) -DEFINE_SPECIAL(Ceiling_MoveToValue, 47, 3, 4) -DEFINE_SPECIAL(Sector_Attach3dMidtex, 48, -1, -1) -DEFINE_SPECIAL(GlassBreak, 49, 0, 1) -DEFINE_SPECIAL(ExtraFloor_LightOnly, 50, -1, -1) -DEFINE_SPECIAL(Sector_SetLink, 51, 4, 4) -DEFINE_SPECIAL(Scroll_Wall, 52, 5, 5) -DEFINE_SPECIAL(Line_SetTextureOffset, 53, 5, 5) -DEFINE_SPECIAL(Sector_ChangeFlags, 54, 3, 3) +// special name, special number, min script args, max script args, num args on a line +DEFINE_SPECIAL(Polyobj_StartLine, 1, -1, -1, 4) +DEFINE_SPECIAL(Polyobj_RotateLeft, 2, 3, 3, 3) +DEFINE_SPECIAL(Polyobj_RotateRight, 3, 3, 3, 3) +DEFINE_SPECIAL(Polyobj_Move, 4, 4, 4, 4) +DEFINE_SPECIAL(Polyobj_ExplicitLine, 5, -1, -1, 5) +DEFINE_SPECIAL(Polyobj_MoveTimes8, 6, 4, 4, 4) +DEFINE_SPECIAL(Polyobj_DoorSwing, 7, 4, 4, 4) +DEFINE_SPECIAL(Polyobj_DoorSlide, 8, 5, 5, 5) +DEFINE_SPECIAL(Line_Horizon, 9, -1, 0, 0) // [RH] draw one-sided wall at horizon +DEFINE_SPECIAL(Door_Close, 10, 2, 3, 3) +DEFINE_SPECIAL(Door_Open, 11, 2, 3, 3) +DEFINE_SPECIAL(Door_Raise, 12, 3, 4, 4) +DEFINE_SPECIAL(Door_LockedRaise, 13, 4, 5, 5) +DEFINE_SPECIAL(Door_Animated, 14, 3, 3, 3) +DEFINE_SPECIAL(Autosave, 15, 0, 0, 0) // [RH] Save the game *now* +DEFINE_SPECIAL(Transfer_WallLight, 16, -1, -1, 2) +DEFINE_SPECIAL(Thing_Raise, 17, 1, 1, 1) +DEFINE_SPECIAL(StartConversation, 18, 1, 2, 2) +DEFINE_SPECIAL(Thing_Stop, 19, 1, 1, 1) +DEFINE_SPECIAL(Floor_LowerByValue, 20, 3, 3, 3) +DEFINE_SPECIAL(Floor_LowerToLowest, 21, 2, 2, 2) +DEFINE_SPECIAL(Floor_LowerToNearest, 22, 2, 2, 2) +DEFINE_SPECIAL(Floor_RaiseByValue, 23, 3, 3, 3) +DEFINE_SPECIAL(Floor_RaiseToHighest, 24, 2, 2, 2) +DEFINE_SPECIAL(Floor_RaiseToNearest, 25, 2, 2, 2) +DEFINE_SPECIAL(Stairs_BuildDown, 26, 5, 5, 5) +DEFINE_SPECIAL(Stairs_BuildUp, 27, 5, 5, 5) +DEFINE_SPECIAL(Floor_RaiseAndCrush, 28, 3, 4, 4) +DEFINE_SPECIAL(Pillar_Build, 29, 3, 3, 3) +DEFINE_SPECIAL(Pillar_Open, 30, 4, 4, 4) +DEFINE_SPECIAL(Stairs_BuildDownSync, 31, 4, 4, 4) +DEFINE_SPECIAL(Stairs_BuildUpSync, 32, 4, 4, 4) +DEFINE_SPECIAL(ForceField, 33, 0, 0, 0) // [RH] Strife's forcefield special (148) +DEFINE_SPECIAL(ClearForceField, 34, 1, 1, 1) // [RH] Remove Strife's forcefield from tagged sectors +DEFINE_SPECIAL(Floor_RaiseByValueTimes8, 35, 3, 3, 3) +DEFINE_SPECIAL(Floor_LowerByValueTimes8, 36, 3, 3, 3) +DEFINE_SPECIAL(Floor_MoveToValue, 37, 3, 4, 4) +DEFINE_SPECIAL(Ceiling_Waggle, 38, 5, 5, 4) // [RH] Complement of Floor_Waggle +DEFINE_SPECIAL(Teleport_ZombieChanger, 39, 2, 2, 2) // [RH] Needed for Strife +DEFINE_SPECIAL(Ceiling_LowerByValue, 40, 3, 3, 3) +DEFINE_SPECIAL(Ceiling_RaiseByValue, 41, 3, 3, 3) +DEFINE_SPECIAL(Ceiling_CrushAndRaise, 42, 3, 4, 4) +DEFINE_SPECIAL(Ceiling_LowerAndCrush, 43, 3, 4, 4) +DEFINE_SPECIAL(Ceiling_CrushStop, 44, 1, 1, 1) +DEFINE_SPECIAL(Ceiling_CrushRaiseAndStay, 45, 3, 4, 4) +DEFINE_SPECIAL(Floor_CrushStop, 46, 1, 1, 1) +DEFINE_SPECIAL(Ceiling_MoveToValue, 47, 3, 4, 4) +DEFINE_SPECIAL(Sector_Attach3dMidtex, 48, -1, -1, 3) +DEFINE_SPECIAL(GlassBreak, 49, 0, 1, 1) +DEFINE_SPECIAL(ExtraFloor_LightOnly, 50, -1, -1, 2) +DEFINE_SPECIAL(Sector_SetLink, 51, 4, 4, 4) +DEFINE_SPECIAL(Scroll_Wall, 52, 5, 5, 5) +DEFINE_SPECIAL(Line_SetTextureOffset, 53, 5, 5, 5) +DEFINE_SPECIAL(Sector_ChangeFlags, 54, 3, 3, 3) -DEFINE_SPECIAL(Plat_PerpetualRaise, 60, 3, 3) -DEFINE_SPECIAL(Plat_Stop, 61, 1, 1) -DEFINE_SPECIAL(Plat_DownWaitUpStay, 62, 3, 3) -DEFINE_SPECIAL(Plat_DownByValue, 63, 4, 4) -DEFINE_SPECIAL(Plat_UpWaitDownStay, 64, 3, 3) -DEFINE_SPECIAL(Plat_UpByValue, 65, 4, 4) -DEFINE_SPECIAL(Floor_LowerInstant, 66, 3, 3) -DEFINE_SPECIAL(Floor_RaiseInstant, 67, 3, 3) -DEFINE_SPECIAL(Floor_MoveToValueTimes8, 68, 4, 4) -DEFINE_SPECIAL(Ceiling_MoveToValueTimes8, 69, 4, 4) -DEFINE_SPECIAL(Teleport, 70, 1, 3) -DEFINE_SPECIAL(Teleport_NoFog, 71, 1, 3) -DEFINE_SPECIAL(ThrustThing, 72, 2, 4) -DEFINE_SPECIAL(DamageThing, 73, 1, 1) -DEFINE_SPECIAL(Teleport_NewMap, 74, 2, 3) -DEFINE_SPECIAL(Teleport_EndGame, 75, 0, 0) -DEFINE_SPECIAL(TeleportOther, 76, 3, 3) -DEFINE_SPECIAL(TeleportGroup, 77, 5, 5) -DEFINE_SPECIAL(TeleportInSector, 78, 4, 5) +DEFINE_SPECIAL(Plat_PerpetualRaise, 60, 3, 3, 3) +DEFINE_SPECIAL(Plat_Stop, 61, 1, 1, 1) +DEFINE_SPECIAL(Plat_DownWaitUpStay, 62, 3, 3, 3) +DEFINE_SPECIAL(Plat_DownByValue, 63, 4, 4, 4) +DEFINE_SPECIAL(Plat_UpWaitDownStay, 64, 3, 3, 3) +DEFINE_SPECIAL(Plat_UpByValue, 65, 4, 4, 4) +DEFINE_SPECIAL(Floor_LowerInstant, 66, 3, 3, 3) +DEFINE_SPECIAL(Floor_RaiseInstant, 67, 3, 3, 3) +DEFINE_SPECIAL(Floor_MoveToValueTimes8, 68, 4, 4, 4) +DEFINE_SPECIAL(Ceiling_MoveToValueTimes8, 69, 4, 4, 4) +DEFINE_SPECIAL(Teleport, 70, 1, 3, 3) +DEFINE_SPECIAL(Teleport_NoFog, 71, 1, 3, 3) +DEFINE_SPECIAL(ThrustThing, 72, 2, 4, 4) +DEFINE_SPECIAL(DamageThing, 73, 1, 2, 2) +DEFINE_SPECIAL(Teleport_NewMap, 74, 2, 3, 3) +DEFINE_SPECIAL(Teleport_EndGame, 75, 0, 0, 0) +DEFINE_SPECIAL(TeleportOther, 76, 3, 3, 3) +DEFINE_SPECIAL(TeleportGroup, 77, 5, 5, 5) +DEFINE_SPECIAL(TeleportInSector, 78, 4, 5, 5) -DEFINE_SPECIAL(ACS_Execute, 80, 1, 5) -DEFINE_SPECIAL(ACS_Suspend, 81, 2, 2) -DEFINE_SPECIAL(ACS_Terminate, 82, 2, 2) -DEFINE_SPECIAL(ACS_LockedExecute, 83, 5, 5) -DEFINE_SPECIAL(ACS_ExecuteWithResult, 84, 1, 4) -DEFINE_SPECIAL(ACS_LockedExecuteDoor, 85, 5, 5) +DEFINE_SPECIAL(ACS_Execute, 80, 1, 5, 5) +DEFINE_SPECIAL(ACS_Suspend, 81, 2, 2, 2) +DEFINE_SPECIAL(ACS_Terminate, 82, 2, 2, 2) +DEFINE_SPECIAL(ACS_LockedExecute, 83, 5, 5, 5) +DEFINE_SPECIAL(ACS_ExecuteWithResult, 84, 1, 4, 4) +DEFINE_SPECIAL(ACS_LockedExecuteDoor, 85, 5, 5, 5) -DEFINE_SPECIAL(Polyobj_OR_RotateLeft, 90, 3, 3) -DEFINE_SPECIAL(Polyobj_OR_RotateRight, 91, 3, 3) -DEFINE_SPECIAL(Polyobj_OR_Move, 92, 4, 4) -DEFINE_SPECIAL(Polyobj_OR_MoveTimes8, 93, 4, 4) -DEFINE_SPECIAL(Pillar_BuildAndCrush, 94, 4, 5) -DEFINE_SPECIAL(FloorAndCeiling_LowerByValue, 95, 3, 3) -DEFINE_SPECIAL(FloorAndCeiling_RaiseByValue, 96, 3, 3) +DEFINE_SPECIAL(Polyobj_OR_RotateLeft, 90, 3, 3, 3) +DEFINE_SPECIAL(Polyobj_OR_RotateRight, 91, 3, 3, 3) +DEFINE_SPECIAL(Polyobj_OR_Move, 92, 4, 4, 4) +DEFINE_SPECIAL(Polyobj_OR_MoveTimes8, 93, 4, 4, 4) +DEFINE_SPECIAL(Pillar_BuildAndCrush, 94, 4, 5, 5) +DEFINE_SPECIAL(FloorAndCeiling_LowerByValue, 95, 3, 3, 3) +DEFINE_SPECIAL(FloorAndCeiling_RaiseByValue, 96, 3, 3, 3) -DEFINE_SPECIAL(Scroll_Texture_Left, 100, -1, -1) -DEFINE_SPECIAL(Scroll_Texture_Right, 101, -1, -1) -DEFINE_SPECIAL(Scroll_Texture_Up, 102, -1, -1) -DEFINE_SPECIAL(Scroll_Texture_Down, 103, -1, -1) +DEFINE_SPECIAL(Scroll_Texture_Left, 100, -1, -1, 2) +DEFINE_SPECIAL(Scroll_Texture_Right, 101, -1, -1, 2) +DEFINE_SPECIAL(Scroll_Texture_Up, 102, -1, -1, 2) +DEFINE_SPECIAL(Scroll_Texture_Down, 103, -1, -1, 2) -DEFINE_SPECIAL(Light_ForceLightning, 109, 1, 1) -DEFINE_SPECIAL(Light_RaiseByValue, 110, 2, 2) -DEFINE_SPECIAL(Light_LowerByValue, 111, 2, 2) -DEFINE_SPECIAL(Light_ChangeToValue, 112, 2, 2) -DEFINE_SPECIAL(Light_Fade, 113, 3, 3) -DEFINE_SPECIAL(Light_Glow, 114, 4, 4) -DEFINE_SPECIAL(Light_Flicker, 115, 3, 3) -DEFINE_SPECIAL(Light_Strobe, 116, 5, 5) -DEFINE_SPECIAL(Light_Stop, 117, 1, 1) +DEFINE_SPECIAL(Light_ForceLightning, 109, 1, 1, 1) +DEFINE_SPECIAL(Light_RaiseByValue, 110, 2, 2, 2) +DEFINE_SPECIAL(Light_LowerByValue, 111, 2, 2, 2) +DEFINE_SPECIAL(Light_ChangeToValue, 112, 2, 2, 2) +DEFINE_SPECIAL(Light_Fade, 113, 3, 3, 3) +DEFINE_SPECIAL(Light_Glow, 114, 4, 4, 4) +DEFINE_SPECIAL(Light_Flicker, 115, 3, 3, 3) +DEFINE_SPECIAL(Light_Strobe, 116, 5, 5, 5) +DEFINE_SPECIAL(Light_Stop, 117, 1, 1, 1) -DEFINE_SPECIAL(Thing_Damage, 119, 2, 3) -DEFINE_SPECIAL(Radius_Quake, 120, 5, 5) // Earthquake -DEFINE_SPECIAL(Line_SetIdentification, 121, -1, -1) +DEFINE_SPECIAL(Thing_Damage, 119, 2, 3, 3) +DEFINE_SPECIAL(Radius_Quake, 120, 5, 5, 5) // Earthquake +DEFINE_SPECIAL(Line_SetIdentification, 121, -1, -1, 5) #if 0 // Skull Tag specials that might be added later Thing_SetGravity, 122, -1, -1) Thing_ReverseGravity, 123, -1, -1) Thing_RevertGravity, 124, -1, -1) #endif -DEFINE_SPECIAL(Thing_Move, 125, 2, 3) +DEFINE_SPECIAL(Thing_Move, 125, 2, 3, 3) #if 0 // Skull Tag special I doubt I will add Thing_SetSprite, 126, -1, -1) #endif -DEFINE_SPECIAL(Thing_SetSpecial, 127, 5, 5) -DEFINE_SPECIAL(ThrustThingZ, 128, 4, 4) -DEFINE_SPECIAL(UsePuzzleItem, 129, 1, 1) -DEFINE_SPECIAL(Thing_Activate, 130, 1, 1) -DEFINE_SPECIAL(Thing_Deactivate, 131, 1, 1) -DEFINE_SPECIAL(Thing_Remove, 132, 1, 1) -DEFINE_SPECIAL(Thing_Destroy, 133, 1, 2) -DEFINE_SPECIAL(Thing_Projectile, 134, 5, 5) -DEFINE_SPECIAL(Thing_Spawn, 135, 3, 4) -DEFINE_SPECIAL(Thing_ProjectileGravity, 136, 5, 5) -DEFINE_SPECIAL(Thing_SpawnNoFog, 137, 3, 4) -DEFINE_SPECIAL(Floor_Waggle, 138, 5, 5) -DEFINE_SPECIAL(Thing_SpawnFacing, 139, 2, 4) -DEFINE_SPECIAL(Sector_ChangeSound, 140, 2, 2) +DEFINE_SPECIAL(Thing_SetSpecial, 127, 5, 5, 5) +DEFINE_SPECIAL(ThrustThingZ, 128, 4, 4, 4) +DEFINE_SPECIAL(UsePuzzleItem, 129, 1, 1, 1) +DEFINE_SPECIAL(Thing_Activate, 130, 1, 1, 1) +DEFINE_SPECIAL(Thing_Deactivate, 131, 1, 1, 1) +DEFINE_SPECIAL(Thing_Remove, 132, 1, 1, 1) +DEFINE_SPECIAL(Thing_Destroy, 133, 1, 2, 2) +DEFINE_SPECIAL(Thing_Projectile, 134, 5, 5, 5) +DEFINE_SPECIAL(Thing_Spawn, 135, 3, 4, 4) +DEFINE_SPECIAL(Thing_ProjectileGravity, 136, 5, 5, 5) +DEFINE_SPECIAL(Thing_SpawnNoFog, 137, 3, 4, 4) +DEFINE_SPECIAL(Floor_Waggle, 138, 5, 5, 5) +DEFINE_SPECIAL(Thing_SpawnFacing, 139, 2, 4, 4) +DEFINE_SPECIAL(Sector_ChangeSound, 140, 2, 2, 2) -DEFINE_SPECIAL(Teleport_NoStop, 154, 2, 3) +DEFINE_SPECIAL(Teleport_NoStop, 154, 2, 3, 3) // GZDoom/Vavoom specials // Although ZDoom doesn't support them it's better to have them defined so that // WADs using them somewhere can at least be started without aborting due // to an error message. -DEFINE_SPECIAL(FS_Execute, 158, 1, 4) -DEFINE_SPECIAL(Sector_SetPlaneReflection, 159, 3, 3) -DEFINE_SPECIAL(Sector_Set3DFloor, 160, -1, -1) -DEFINE_SPECIAL(Sector_SetContents, 161, -1, -1) +DEFINE_SPECIAL(FS_Execute, 158, 1, 4, 4) +DEFINE_SPECIAL(Sector_SetPlaneReflection, 159, 3, 3, 3) +DEFINE_SPECIAL(Sector_Set3DFloor, 160, -1, -1, 5) +DEFINE_SPECIAL(Sector_SetContents, 161, -1, -1, 5) // It probably doesn't use 5 args. Oh well. // [RH] Begin new specials for ZDoom -DEFINE_SPECIAL(Generic_Crusher2, 169, 5, 5) -DEFINE_SPECIAL(Sector_SetCeilingScale2, 170, 3, 3) -DEFINE_SPECIAL(Sector_SetFloorScale2, 171, 3, 3) -DEFINE_SPECIAL(Plat_UpNearestWaitDownStay, 172, 3, 3) -DEFINE_SPECIAL(NoiseAlert, 173, 2, 2) -DEFINE_SPECIAL(SendToCommunicator, 174, 4, 4) -DEFINE_SPECIAL(Thing_ProjectileIntercept, 175, 5, 5) -DEFINE_SPECIAL(Thing_ChangeTID, 176, 2, 2) -DEFINE_SPECIAL(Thing_Hate, 177, 2, 3) -DEFINE_SPECIAL(Thing_ProjectileAimed, 178, 4, 5) -DEFINE_SPECIAL(ChangeSkill, 179, 1, 1) -DEFINE_SPECIAL(Thing_SetTranslation, 180, 2, 2) -DEFINE_SPECIAL(Plane_Align, 181, -1, -1) -DEFINE_SPECIAL(Line_Mirror, 182, -1, 0) -DEFINE_SPECIAL(Line_AlignCeiling, 183, 2, 2) -DEFINE_SPECIAL(Line_AlignFloor, 184, 2, 2) -DEFINE_SPECIAL(Sector_SetRotation, 185, 3, 3) -DEFINE_SPECIAL(Sector_SetCeilingPanning, 186, 5, 5) -DEFINE_SPECIAL(Sector_SetFloorPanning, 187, 5, 5) -DEFINE_SPECIAL(Sector_SetCeilingScale, 188, 5, 5) -DEFINE_SPECIAL(Sector_SetFloorScale, 189, 5, 5) -DEFINE_SPECIAL(Static_Init, 190, -1, -1) -DEFINE_SPECIAL(SetPlayerProperty, 191, 3, 3) -DEFINE_SPECIAL(Ceiling_LowerToHighestFloor, 192, 2, 2) -DEFINE_SPECIAL(Ceiling_LowerInstant, 193, 3, 3) -DEFINE_SPECIAL(Ceiling_RaiseInstant, 194, 3, 3) -DEFINE_SPECIAL(Ceiling_CrushRaiseAndStayA, 195, 4, 5) -DEFINE_SPECIAL(Ceiling_CrushAndRaiseA, 196, 4, 5) -DEFINE_SPECIAL(Ceiling_CrushAndRaiseSilentA, 197, 4, 5) -DEFINE_SPECIAL(Ceiling_RaiseByValueTimes8, 198, 3, 3) -DEFINE_SPECIAL(Ceiling_LowerByValueTimes8, 199, 3, 3) -DEFINE_SPECIAL(Generic_Floor, 200, 5, 5) -DEFINE_SPECIAL(Generic_Ceiling, 201, 5, 5) -DEFINE_SPECIAL(Generic_Door, 202, 5, 5) -DEFINE_SPECIAL(Generic_Lift, 203, 5, 5) -DEFINE_SPECIAL(Generic_Stairs, 204, 5, 5) -DEFINE_SPECIAL(Generic_Crusher, 205, 5, 5) -DEFINE_SPECIAL(Plat_DownWaitUpStayLip, 206, 4, 5) -DEFINE_SPECIAL(Plat_PerpetualRaiseLip, 207, 4, 4) -DEFINE_SPECIAL(TranslucentLine, 208, 2, 3) -DEFINE_SPECIAL(Transfer_Heights, 209, -1, -1) -DEFINE_SPECIAL(Transfer_FloorLight, 210, -1, -1) -DEFINE_SPECIAL(Transfer_CeilingLight, 211, -1, -1) -DEFINE_SPECIAL(Sector_SetColor, 212, 4, 5) -DEFINE_SPECIAL(Sector_SetFade, 213, 4, 4) -DEFINE_SPECIAL(Sector_SetDamage, 214, 3, 3) -DEFINE_SPECIAL(Teleport_Line, 215, 2, 2) -DEFINE_SPECIAL(Sector_SetGravity, 216, 3, 3) -DEFINE_SPECIAL(Stairs_BuildUpDoom, 217, 5, 5) -DEFINE_SPECIAL(Sector_SetWind, 218, 4, 4) -DEFINE_SPECIAL(Sector_SetFriction, 219, 2, 2) -DEFINE_SPECIAL(Sector_SetCurrent, 220, 4, 4) -DEFINE_SPECIAL(Scroll_Texture_Both, 221, 5, 5) -DEFINE_SPECIAL(Scroll_Texture_Model, 222, -1, -1) -DEFINE_SPECIAL(Scroll_Floor, 223, 4, 4) -DEFINE_SPECIAL(Scroll_Ceiling, 224, 4, 4) -DEFINE_SPECIAL(Scroll_Texture_Offsets, 225, -1, -1) -DEFINE_SPECIAL(ACS_ExecuteAlways, 226, 1, 5) -DEFINE_SPECIAL(PointPush_SetForce, 227, -1, -1) -DEFINE_SPECIAL(Plat_RaiseAndStayTx0, 228, 2, 2) -DEFINE_SPECIAL(Thing_SetGoal, 229, 3, 4) -DEFINE_SPECIAL(Plat_UpByValueStayTx, 230, 3, 3) -DEFINE_SPECIAL(Plat_ToggleCeiling, 231, 1, 1) -DEFINE_SPECIAL(Light_StrobeDoom, 232, 3, 3) -DEFINE_SPECIAL(Light_MinNeighbor, 233, 1, 1) -DEFINE_SPECIAL(Light_MaxNeighbor, 234, 1, 1) -DEFINE_SPECIAL(Floor_TransferTrigger, 235, 1, 1) -DEFINE_SPECIAL(Floor_TransferNumeric, 236, 1, 1) -DEFINE_SPECIAL(ChangeCamera, 237, 3, 3) -DEFINE_SPECIAL(Floor_RaiseToLowestCeiling, 238, 2, 2) -DEFINE_SPECIAL(Floor_RaiseByValueTxTy, 239, 3, 3) -DEFINE_SPECIAL(Floor_RaiseByTexture, 240, 2, 2) -DEFINE_SPECIAL(Floor_LowerToLowestTxTy, 241, 2, 2) -DEFINE_SPECIAL(Floor_LowerToHighest, 242, 3, 3) -DEFINE_SPECIAL(Exit_Normal, 243, 1, 1) -DEFINE_SPECIAL(Exit_Secret, 244, 1, 1) -DEFINE_SPECIAL(Elevator_RaiseToNearest, 245, 2, 2) -DEFINE_SPECIAL(Elevator_MoveToFloor, 246, 2, 2) -DEFINE_SPECIAL(Elevator_LowerToNearest, 247, 2, 2) -DEFINE_SPECIAL(HealThing, 248, 1, 2) -DEFINE_SPECIAL(Door_CloseWaitOpen, 249, 3, 4) -DEFINE_SPECIAL(Floor_Donut, 250, 3, 3) -DEFINE_SPECIAL(FloorAndCeiling_LowerRaise, 251, 3, 3) -DEFINE_SPECIAL(Ceiling_RaiseToNearest, 252, 2, 2) -DEFINE_SPECIAL(Ceiling_LowerToLowest, 253, 2, 2) -DEFINE_SPECIAL(Ceiling_LowerToFloor, 254, 2, 2) -DEFINE_SPECIAL(Ceiling_CrushRaiseAndStaySilA, 255, 4, 5) +DEFINE_SPECIAL(Generic_Crusher2, 169, 5, 5, 5) +DEFINE_SPECIAL(Sector_SetCeilingScale2, 170, 3, 3, 3) +DEFINE_SPECIAL(Sector_SetFloorScale2, 171, 3, 3, 3) +DEFINE_SPECIAL(Plat_UpNearestWaitDownStay, 172, 3, 3, 3) +DEFINE_SPECIAL(NoiseAlert, 173, 2, 2, 2) +DEFINE_SPECIAL(SendToCommunicator, 174, 4, 4, 4) +DEFINE_SPECIAL(Thing_ProjectileIntercept, 175, 5, 5, 5) +DEFINE_SPECIAL(Thing_ChangeTID, 176, 2, 2, 2) +DEFINE_SPECIAL(Thing_Hate, 177, 2, 3, 3) +DEFINE_SPECIAL(Thing_ProjectileAimed, 178, 4, 5, 5) +DEFINE_SPECIAL(ChangeSkill, 179, 1, 1, 1) +DEFINE_SPECIAL(Thing_SetTranslation, 180, 2, 2, 2) +DEFINE_SPECIAL(Plane_Align, 181, -1, -1, 2) +DEFINE_SPECIAL(Line_Mirror, 182, -1, 0, 0) +DEFINE_SPECIAL(Line_AlignCeiling, 183, 2, 2, 2) +DEFINE_SPECIAL(Line_AlignFloor, 184, 2, 2, 2) +DEFINE_SPECIAL(Sector_SetRotation, 185, 3, 3, 3) +DEFINE_SPECIAL(Sector_SetCeilingPanning, 186, 5, 5, 5) +DEFINE_SPECIAL(Sector_SetFloorPanning, 187, 5, 5, 5) +DEFINE_SPECIAL(Sector_SetCeilingScale, 188, 5, 5, 5) +DEFINE_SPECIAL(Sector_SetFloorScale, 189, 5, 5, 5) +DEFINE_SPECIAL(Static_Init, 190, -1, -1, 3) +DEFINE_SPECIAL(SetPlayerProperty, 191, 3, 3, 3) +DEFINE_SPECIAL(Ceiling_LowerToHighestFloor, 192, 2, 2, 2) +DEFINE_SPECIAL(Ceiling_LowerInstant, 193, 3, 3, 3) +DEFINE_SPECIAL(Ceiling_RaiseInstant, 194, 3, 3, 3) +DEFINE_SPECIAL(Ceiling_CrushRaiseAndStayA, 195, 4, 5, 5) +DEFINE_SPECIAL(Ceiling_CrushAndRaiseA, 196, 4, 5, 5) +DEFINE_SPECIAL(Ceiling_CrushAndRaiseSilentA, 197, 4, 5, 5) +DEFINE_SPECIAL(Ceiling_RaiseByValueTimes8, 198, 3, 3, 3) +DEFINE_SPECIAL(Ceiling_LowerByValueTimes8, 199, 3, 3, 3) +DEFINE_SPECIAL(Generic_Floor, 200, 5, 5, 5) +DEFINE_SPECIAL(Generic_Ceiling, 201, 5, 5, 5) +DEFINE_SPECIAL(Generic_Door, 202, 5, 5, 5) +DEFINE_SPECIAL(Generic_Lift, 203, 5, 5, 5) +DEFINE_SPECIAL(Generic_Stairs, 204, 5, 5, 5) +DEFINE_SPECIAL(Generic_Crusher, 205, 5, 5, 5) +DEFINE_SPECIAL(Plat_DownWaitUpStayLip, 206, 4, 5, 5) +DEFINE_SPECIAL(Plat_PerpetualRaiseLip, 207, 4, 4, 4) +DEFINE_SPECIAL(TranslucentLine, 208, 2, 3, 3) +DEFINE_SPECIAL(Transfer_Heights, 209, -1, -1, 2) +DEFINE_SPECIAL(Transfer_FloorLight, 210, -1, -1, 1) +DEFINE_SPECIAL(Transfer_CeilingLight, 211, -1, -1, 1) +DEFINE_SPECIAL(Sector_SetColor, 212, 4, 5, 5) +DEFINE_SPECIAL(Sector_SetFade, 213, 4, 4, 4) +DEFINE_SPECIAL(Sector_SetDamage, 214, 3, 3, 3) +DEFINE_SPECIAL(Teleport_Line, 215, 2, 3, 3) +DEFINE_SPECIAL(Sector_SetGravity, 216, 3, 3, 3) +DEFINE_SPECIAL(Stairs_BuildUpDoom, 217, 5, 5, 5) +DEFINE_SPECIAL(Sector_SetWind, 218, 4, 4, 4) +DEFINE_SPECIAL(Sector_SetFriction, 219, 2, 2, 2) +DEFINE_SPECIAL(Sector_SetCurrent, 220, 4, 4, 4) +DEFINE_SPECIAL(Scroll_Texture_Both, 221, 5, 5, 5) +DEFINE_SPECIAL(Scroll_Texture_Model, 222, -1, -1, 2) +DEFINE_SPECIAL(Scroll_Floor, 223, 4, 4, 5) +DEFINE_SPECIAL(Scroll_Ceiling, 224, 4, 4, 5) +DEFINE_SPECIAL(Scroll_Texture_Offsets, 225, -1, -1, 1) +DEFINE_SPECIAL(ACS_ExecuteAlways, 226, 1, 5, 5) +DEFINE_SPECIAL(PointPush_SetForce, 227, -1, -1, 4) +DEFINE_SPECIAL(Plat_RaiseAndStayTx0, 228, 2, 2, 2) +DEFINE_SPECIAL(Thing_SetGoal, 229, 3, 4, 4) +DEFINE_SPECIAL(Plat_UpByValueStayTx, 230, 3, 3, 3) +DEFINE_SPECIAL(Plat_ToggleCeiling, 231, 1, 1, 1) +DEFINE_SPECIAL(Light_StrobeDoom, 232, 3, 3, 3) +DEFINE_SPECIAL(Light_MinNeighbor, 233, 1, 1, 1) +DEFINE_SPECIAL(Light_MaxNeighbor, 234, 1, 1, 1) +DEFINE_SPECIAL(Floor_TransferTrigger, 235, 1, 1, 1) +DEFINE_SPECIAL(Floor_TransferNumeric, 236, 1, 1, 1) +DEFINE_SPECIAL(ChangeCamera, 237, 3, 3, 3) +DEFINE_SPECIAL(Floor_RaiseToLowestCeiling, 238, 2, 2, 2) +DEFINE_SPECIAL(Floor_RaiseByValueTxTy, 239, 3, 3, 3) +DEFINE_SPECIAL(Floor_RaiseByTexture, 240, 2, 2, 2) +DEFINE_SPECIAL(Floor_LowerToLowestTxTy, 241, 2, 2, 2) +DEFINE_SPECIAL(Floor_LowerToHighest, 242, 3, 3, 3) +DEFINE_SPECIAL(Exit_Normal, 243, 1, 1, 1) +DEFINE_SPECIAL(Exit_Secret, 244, 1, 1, 1) +DEFINE_SPECIAL(Elevator_RaiseToNearest, 245, 2, 2, 2) +DEFINE_SPECIAL(Elevator_MoveToFloor, 246, 2, 2, 2) +DEFINE_SPECIAL(Elevator_LowerToNearest, 247, 2, 2, 2) +DEFINE_SPECIAL(HealThing, 248, 1, 2, 2) +DEFINE_SPECIAL(Door_CloseWaitOpen, 249, 3, 4, 4) +DEFINE_SPECIAL(Floor_Donut, 250, 3, 3, 3) +DEFINE_SPECIAL(FloorAndCeiling_LowerRaise, 251, 3, 3, 3) +DEFINE_SPECIAL(Ceiling_RaiseToNearest, 252, 2, 2, 2) +DEFINE_SPECIAL(Ceiling_LowerToLowest, 253, 2, 2, 2) +DEFINE_SPECIAL(Ceiling_LowerToFloor, 254, 2, 2, 2) +DEFINE_SPECIAL(Ceiling_CrushRaiseAndStaySilA, 255, 4, 5, 5) #undef DEFINE_SPECIAL diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index c154ef814..b34ed4878 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -3193,18 +3193,29 @@ lnSpecFunc LineSpecials[256] = LS_Ceiling_CrushRaiseAndStaySilA }; -struct FLineSpecial -{ - const char *name; - BYTE number; - SBYTE min_args; - SBYTE max_args; -}; - -#define DEFINE_SPECIAL(name, num, min, max) {#name, num, min, max}, -static FLineSpecial LineSpecialNames[]={ +#define DEFINE_SPECIAL(name, num, min, max, mmax) {#name, num, min, max, mmax}, +static FLineSpecial LineSpecialNames[] = { #include "actionspecials.h" }; +const FLineSpecial *LineSpecialsInfo[256]; + +static int STACK_ARGS lscmp (const void * a, const void * b) +{ + return stricmp( ((FLineSpecial*)a)->name, ((FLineSpecial*)b)->name); +} + +static struct InitLineSpecials +{ + InitLineSpecials() + { + qsort(LineSpecialNames, countof(LineSpecialNames), sizeof(FLineSpecial), lscmp); + for (size_t i = 0; i < countof(LineSpecialNames); ++i) + { + assert(LineSpecialsInfo[LineSpecialNames[i].number] == NULL); + LineSpecialsInfo[LineSpecialNames[i].number] = &LineSpecialNames[i]; + } + } +} DoInit; //========================================================================== // @@ -3213,22 +3224,9 @@ static FLineSpecial LineSpecialNames[]={ // Finds a line special and also returns the min and max argument count. // //========================================================================== -static int STACK_ARGS lscmp (const void * a, const void * b) -{ - return stricmp( ((FLineSpecial*)a)->name, ((FLineSpecial*)b)->name); -} - int P_FindLineSpecial (const char *string, int *min_args, int *max_args) { - static bool sorted=false; - - if (!sorted) - { - qsort(LineSpecialNames, countof(LineSpecialNames), sizeof(FLineSpecial), lscmp); - sorted = true; - } - int min = 0, max = countof(LineSpecialNames) - 1; while (min <= max) @@ -3252,4 +3250,3 @@ int P_FindLineSpecial (const char *string, int *min_args, int *max_args) } return 0; } - diff --git a/src/p_lnspec.h b/src/p_lnspec.h index e298adcb2..495947243 100644 --- a/src/p_lnspec.h +++ b/src/p_lnspec.h @@ -37,12 +37,23 @@ #include "doomtype.h" -#define DEFINE_SPECIAL(name, num, min, max) name = num, +#define DEFINE_SPECIAL(name, num, min, max, map) name = num, typedef enum { #include "actionspecials.h" } linespecial_t; +struct FLineSpecial +{ + const char *name; + BYTE number; + SBYTE min_args; + SBYTE max_args; + BYTE map_args; +}; + +extern const FLineSpecial *LineSpecialsInfo[256]; + typedef enum { Init_Gravity = 0, Init_Color = 1, diff --git a/src/p_spec.cpp b/src/p_spec.cpp index c8b8724cc..4dfd9e4c7 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -972,7 +972,8 @@ void P_SpawnSpecials (void) P_SpawnFriction(); // phares 3/12/98: New friction model using linedefs P_SpawnPushers(); // phares 3/20/98: New pusher model using linedefs - for (i=0; ispecial; + // Check for undefined parameters that are non-zero and output messages for them. + // We don't report for specials we don't understand. + if (special != 0) + { + int max = LineSpecialsInfo[special] != NULL ? LineSpecialsInfo[special]->map_args : countof(l->args); + for (int arg = max; arg < countof(l->args); ++arg) + { + if (l->args[arg] != 0) + { + Printf("Line %d (type %d:%s), arg %d is %d (should be 0)\n", + i, special, LineSpecialsInfo[special]->name, arg+1, l->args[arg]); + } + } + } + // killough 3/7/98: Types 245-249 are same as 250-254 except that the // first side's sector's heights cause scrolling when they change, and // this linedef controls the direction and speed of the scrolling. The diff --git a/zdoom.vcproj b/zdoom.vcproj index f72913c08..2b0c1b899 100644 --- a/zdoom.vcproj +++ b/zdoom.vcproj @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - @@ -1872,6 +1864,14 @@ Outputs="$(IntDir)/$(InputName).obj" /> + + + @@ -2061,6 +2061,14 @@ Outputs="$(IntDir)\$(InputName).obj" /> + + + @@ -2071,14 +2079,6 @@ Outputs="$(IntDir)\$(InputName).obj" /> - - - + + + - - - + + + @@ -5383,14 +5391,6 @@ AdditionalIncludeDirectories="src\win32;$(NoInherit)" /> - - - @@ -5669,7 +5669,7 @@ />