Commit graph

220 commits

Author SHA1 Message Date
Christoph Oelckers
7ade3b829b - moved MF_INCHASE to flags7.
Due to how the MBF21 flag checkers work the first flag word may not repurpose any unused flags in it. We still need MF_SLIDE to be usable by them, despite being totally unused.
2021-07-01 08:55:01 +02:00
alexey.lysiuk
29f6dd23b9 - fixed compilation with GCC and Clang
src/playsim/p_maputl.cpp:1691:42: error: too many arguments provided to function-like macro invocation
src/gamedata/d_dehacked.cpp:2385:62: error: cannot pass non-trivial object of type 'FString' to variadic function;
2021-07-01 09:24:33 +03:00
Christoph Oelckers
c700682a36 - MBF21: ported the code pointers to ZScript.
So far it's just the functions and some initial changes to Dehacked's parser. None of this is usable yet.
2021-07-01 00:53:15 +02:00
Christoph Oelckers
b043a5a5de - add melee range support to A_Saw and A_Punch.
This is merely for MBF21 support and not a recommended editing feature! There are better ways to define the range of a player's attack!
2021-06-30 14:48:13 +02:00
alexey.lysiuk
a9ad3d1fc3 - prevent appearance of dangling pointers in corpse queue
A dangling pointer in corpse queue may appear if actor is added to the queue when GC is in propagation state.
Enqueued corpse actor remains white, and if it’s destroyed and garbage collected before dequeue, a dangling pointer will be accessed during its removal from the queue.
In console, do `summon CorpseSpawner` and `gc now` with the following script loaded. Without a write barrier, it will crash in two seconds.

```
class TestCorpse : Actor
{
	States
	{
	Spawn:
		POSS U 1 A_Die;
	Death:
		POSS U 1 A_QueueCorpse;
		Stop;
	}
}

class CorpseSpawner : Actor
{
	override void Tick()
	{
		A_SpawnItem("TestCorpse");
	}
}
```

https://forum.zdoom.org/viewtopic.php?t=69842
2021-06-30 10:19:08 +03:00
Christoph Oelckers
9b3782ea0f - MBF21: remaining actor properties. 2021-06-29 22:32:38 +02:00
Christoph Oelckers
e2e8ec8b3e - MBF21: implemented thing flags. 2021-06-29 21:08:58 +02:00
Christoph Oelckers
0bb5ec0d22 - MBF21: splash group. 2021-06-29 17:47:52 +02:00
Christoph Oelckers
cc801a7efa - MBF21: added projectile group. 2021-06-29 17:33:16 +02:00
Christoph Oelckers
bca8d01ab3 - MBF21: infighting groups. 2021-06-29 01:34:14 +02:00
Christoph Oelckers
3bef08b1aa - MBF21: implemented the new line scroller types.
These extend the parameter set of Scroll_Texture_Offsets, so in Hexen/UDMF format the advanced scroll types are also available for the tag-less variant.
2021-06-28 22:06:07 +02:00
Christoph Oelckers
c4ed0cefde - MBF21: implemented new line flags.
While 'block players' was just a simple remap, 'block land monsters' required quite a bit of work...
This also fixes the bug that BLOCK_FLOATERS was never checked for sliding against a wall.
2021-06-28 20:17:08 +02:00
Christoph Oelckers
057cc0678b - MBF21: handling of new flags in sector special. 2021-06-28 16:20:35 +02:00
Christoph Oelckers
30e24938ca - let dynamic lights call UpdateLocation instead of just setting their position right after being spawned.
This ensures that the position is correct and that everything gets set up properly.
2021-05-31 22:13:40 +02:00
Zandrewnum
acb4d89f52 APROP_Soundclass update again
- Just set init for SoundClass to empty.
- Removed code block from SetActorProperty for APROP_Soundclass that does nothing
- Lower-cased soundclass in FSerializer
- Created a new const char to read the player's soundclass. If the playerpawn returns NAME_None for it's default, then it will set defaultsoundclass to "player". After running the skin code, the function now returns defaultsoundclass or soundclass, depending if soundclass is empty or not.
- Renamed GetSoundClass to S_GetSoundClass
2021-05-28 20:22:37 +02:00
Zandrewnum
a5cf0c6605 Sound Class renovations
- SoundClass is instantiated to "" by default. Since this property is only used when it is not empty (otherwise GetSoundClass just defaults to player), we can get away with this.
- We may want the soundclass to remain the same if we explicitly set it to the same one that is currently used (say, we set SoundClass to "Caleb" so all other skins can use it)
- GetActorProperty for APROP_SoundClass just calls GetSoundClass,
- CheckActorProperty also just runs GetSoundClass
- GetSoundClass is no longer a static method. We needed to access it in other places.
- Made renovations to GetSoundClass. First of all, SoundClass is no longer instantiated there. Secondly, skinned sounds are now returned if SoundClass is empty. Thirdly, "sclass" in this method will return the default soundclass of the player pawn or SoundClass, depending on if SoundClass is empty. Finally, sclass will retrieve "player" if it is empty.
2021-05-28 20:22:37 +02:00
Shiny Metagross
4c9461d364 Update d_player.h
- Deleted some comment fragments I left when trying to get the SoundClass to init to NAME_SoundClass
2021-05-28 20:22:37 +02:00
Zandrewnum
c7cd25cbcc Made S_FindSkinnedSound to use GetSoundClass again
- I couldn't simply init SoundClass to NAME_SoundClass, even after converting it to the appropriate type. Probably because NAME_SoundClass hasn't been parsed from decorate yet. Instead, I change it to NAME_SoundClass through GetSoundClass if it's valid and currently "player".
- The skin checker code in GetSoundClass now checks if the SoundClass is equal to NAME_SoundClass. This mechanism exists so that way reverting the SoundClass to NAME_SoundClass processes the skin soundclass code. If it's different, the code is not processed.
- Just returns sclass. This is never null, so there's no need to check if so.
- S_FindSkinnedSound just uses GetSoundClass. This makes sure skins are checked.
2021-05-28 20:22:37 +02:00
Zandrewnum
f6bdbfe535 APROP_SoundClass inits a default value and checks for null pointers
- Gave default init value to SoundClass as "Player"
- Changed SoundClass detection to use the if/else structure
- Checked for null pointer in S_FindSkinnedSound when reading the player's sound class
2021-05-28 20:22:37 +02:00
Zandrewnum
852a96497d Added APROP_SoundClass
- Added APROP_SoundClass to GetActorProperty, SetActorProperty, CheckActorProperty
2021-05-28 20:22:37 +02:00
Christoph Oelckers
20b665c161 - fixed: Actors did not set the position when spawning a dynamic light.
It always reused the previous content of the 'Pos' field which was either undefined or an older position where the actor was located when last spawning a light.
2021-05-28 11:25:01 +02:00
nashmuhandes
aeaa7f21c7 Add some new optional parameters to A_SprayDecal:
- useBloodColor: when true, the sprayed decal will be shaded to match the calling actor's blood color.
- decalColor: when defined, the sprayed decal will be shaded to the specified color. Note that this will take precedence over useBloodColor. It is recommended to use only one parameter.

Note that due to how decals work in the engine, the "decalColor" parameter will only properly colorize the decal if the image is grayscale.
2021-05-22 10:20:52 -04:00
Cacodemon345
9a860ae445 Account for portals when spawning missiles in A_FireBullets/A_CustomBulletAttack
This also gives the caller the information whether the LineAttack
hitscan passed through a portal regardless of whether it actually hit an
actor or not as a nice bonus.
2021-05-20 19:42:29 +02:00
Christoph Oelckers
9df70cd0df - change switch checking back to vanilla order. 2021-05-19 19:25:32 +02:00
Christoph Oelckers
97b8c0ccfb Revert "- fixed some uses of postincre,ment/decrements on narrow types."
This reverts commit 668f8f2cf6.

Revert "- added a proper error message when '--' or '++' gets used on 8 or 16 bit values."

This reverts commit a94f5dd1b3.

None of this was necessary - the triggered assert was bogus and had to be removed.
2021-05-17 18:13:30 +02:00
Christoph Oelckers
668f8f2cf6 - fixed some uses of postincre,ment/decrements on narrow types.
THe VM has no opcode for this, all these places produced code with undefined behavior.
2021-05-17 12:42:22 +02:00
Christoph Oelckers
5077973012 - fixed A_CheckTerrain's check for instant death sectors.
This was still checking the sector special even though this had been reactored 5 years ago.
2021-05-17 12:00:16 +02:00
nashmuhandes
5446a1a355 Add sprite shadows for the software renderer 2021-04-24 22:40:54 -04:00
James Le Cuirot
90381c4ad6 Allow ACS SpawnDecal zoffset and distance args to be fixed point
The wiki currently says they should be fixed point but the code
currently treats them as integers. Given that they are placed with
double precision horizontally, it is odd that the same precision
cannot be applied vertically. Changing this would break existing maps
so add two flags to support both types.
2021-04-24 14:37:20 -04:00
Nikolay Ambartsumov
cf30982ddf Add Polyobj_StopSound special 2021-04-24 15:31:04 -03:00
alexey.lysiuk
de0361842f - removed useless initializations in binds printing ACS code
variables are initialized by FKeyBindings::GetKeysForCommand() anyway
2021-04-19 18:05:52 +03:00
sgrunt
0c776e3acd Move the modified behaviour to a new "resetvel" parameter 2021-03-19 20:12:20 +01:00
sgrunt
3873ad6151 Fix behaviour of VelIntercept's oldvel parameter
Previously Vel would be reset only if the target was moving. This change
ensures that Vel is always reset, as seems to be the intent of the
oldvel parameter.
2021-03-19 20:12:20 +01:00
drfrag
cdbae4b5d9 - Fixed crash with voodoo dolls in MP after players quit the game. 2021-03-19 20:10:39 +01:00
nashmuhandes
b28e5cb917 Add GetCharacterName() to retrieve an NPC's name as defined in its dialogue script, if it exists. Otherwise it will just return the same output as GetTag(). 2021-03-15 21:31:16 +01:00
drfrag
12aa7a8ff6 - Fix crash with wind effect on special water sectors. 2021-03-10 13:37:57 +01:00
nashmuhandes
b7bbfd4efd Add SetSubtitleNumber(int num, str sound) ACS function. Works exactly like its ZScript counterpart. The activator of the script must be a player. 2021-03-09 09:37:10 +01:00
Timothy Quinn
fa2228d523 - Line_QuickPortal must check the partner line's special. 2021-03-05 16:40:12 +01:00
Timothy Quinn
7e74d1c4a1 - ported Eternity's Line_QuickPortal 2021-03-04 22:54:36 +01:00
Cacodemon345
b5f80bb69c Hitscan attacks can now hit SPECTRAL actors if the hitscan puff has SPECTRAL flag set 2021-02-02 03:33:23 -05:00
Kevin Caccamo
26eac560dd Fix ScriptCall missing default arguments
There was one VMCall in DLevelScript::ScriptCall that didn't use default arguments. This was causing assertion failures in the GZDoom debug build when trying to run Wolfenstein: Blade of Agony on any map that wasn't TITLEMAP, because ACSTools.FindInventoryClass returns a boolean, and it has a default argument.
2021-01-16 17:11:39 +01:00
Marisa Kirisame
44b4359ba5 Add alternate "Full" mode for PowerIronFeet that prevents leaky damage. 2021-01-16 17:09:57 +01:00
drfrag
24cf27e9e2 - Fix ALWAYSFAST actor flag. 2021-01-13 20:13:52 +01:00
Rachael Alexanderson
476e59fbab - add sv_instantreaction dmflag 2021-01-13 07:04:18 -05:00
drfrag
4ff72e937f - Fixed: Monster reaction time was always zero with fast monsters and not just on nightmare. 2021-01-13 06:30:13 -05:00
Rachael Alexanderson
e6c71c2f0c - reimplement fix #1267 from @drfrag666 differently - fix damagecount overflow 2021-01-05 11:09:19 -05:00
Christoph Oelckers
e19b1b2ee7 - fixed: IceGuyFX2 set its owner too late. 2020-11-25 07:37:17 +01:00
Christoph Oelckers
58d8ce1a4f - cleanup of m_fixed.h.
With fixed point math barely being used anywhere with the vast majority of calls in the software voxel drawer it makes sense to reduce the function interface to the minimum possible and move the shift value into the function call as an argument.
2020-11-22 10:25:04 +01:00
Player701
7ff79546e4 - Fixed: If AbsorbDamage resulted in an item having been destroyed, the following items in the inventory chain were not processed. 2020-11-17 12:54:05 +01:00
Chronos Ouroboros
75c791ecff Fixed the previous commit not accounting for mods that already fixed this internally. 2020-11-14 14:53:43 -03:00