Commit Graph

16067 Commits

Author SHA1 Message Date
Christoph Oelckers 0e095b0c05 - removed all direct references of AInventory::Owner and AInventory::Amount from the C++ code. 2018-12-03 17:41:05 +01:00
Marisa Kirisame d6d3dd038e Fix RemoveInventory not calling DetachFromOwner when an item is the first in the owner's inventory.
Fix CheckAddToSlots not working because it uses GetReplacement incorrectly.
2018-12-03 17:29:08 +01:00
Christoph Oelckers 53291b0abf Merge branch 'master' of https://github.com/coelckers/gzdoom 2018-12-03 15:54:09 +01:00
Christoph Oelckers 40a67b8c9a - fixed issues with Dehacked's ad-hoc script code generation
* The functions had no prototype and caused crashes.
* even after creating a prototype it didn't work because CreateAnonymousFunction was set up incorrectly for the case where a known return type was given.
2018-12-03 12:24:55 +01:00
Magnus Norddahl 1e30bc72fe - compare against the thing renderstyle since the local copy has been modified 2018-12-03 11:10:40 +01:00
Magnus Norddahl 4604c9379c - disable alpha test on models if the renderstyle isn't STYLE_Normal 2018-12-03 10:46:28 +01:00
Christoph Oelckers 39d90d022b - made the BUddha checks readable again. 2018-12-03 09:48:05 +01:00
Christoph Oelckers d7bb1726ab - fixed compile warning 2018-12-03 09:14:11 +01:00
Christoph Oelckers 099b278f18 - removed assert that got triggered in an edge case that must pass here. 2018-12-02 23:35:18 +01:00
Christoph Oelckers d222e82bbc - implemented missing 'exact' parameter for ThinkerIterator.Next. 2018-12-02 23:15:34 +01:00
Christoph Oelckers d96d505520 - fixed accidentally misnamed parameter in A_Explode. 2018-12-02 21:39:28 +01:00
Christoph Oelckers bfcd714186 - started replacing direct references to class AInventory.
The easiest part was the type checks which could be changed to the name variant with a global search and replace.
2018-12-02 21:35:55 +01:00
Major Cooke 6fd3bea38c - fixed: P_PoisonPlayer and P_PoisonDamage did not check for NODAMAGE.
- fixed: P_PoisonDamage's check for Buddha2 and the Buddha powerup were inverted.
- fixed: P_PoisonDamage checked the modified damage instead of the raw, allowing amplifiers to boost the damage beyond telefrag and circumventing regular buddha.
2018-12-02 21:14:22 +01:00
Christoph Oelckers 807df33e1a - scriptified AInventory::Tick.
This was the last bit of code standing in the way of making AInventory a fully scripted class.
All that's left to sort out is some variable accesses - the vast majority of them in SBARINFO.
2018-12-02 20:58:15 +01:00
Magnus Norddahl d88d173b38 - ptest is a SSE 4.1 instruction 2018-12-02 20:44:36 +01:00
Christoph Oelckers 2e383073e8 - scriptified the AutoUseHealth feature.
This again is a piece of code that reads and even writes to inventory items' properties, so better have it on the script side.
2018-12-02 19:45:45 +01:00
Christoph Oelckers 3182569fb8 - scriptified the decision making of the invuseall CCMD.
Custom items had no way to adjust to this - and it also was the last native access to ItemFlags.
2018-12-02 18:43:38 +01:00
Christoph Oelckers 93f91d1039 - scriptified P_DropItem. 2018-12-02 18:31:18 +01:00
Christoph Oelckers a5fc26b37c - scriptified the no-spawn flag check for armor and health items. 2018-12-02 18:04:44 +01:00
Christoph Oelckers 319f8743db - consolidated the check for "is actor an owned inventory item" into a subfunction.
This check occured 9 times in the source, better have it only once.
2018-12-02 16:53:12 +01:00
Christoph Oelckers ee08412e49 - scriptified G_PlayerFinishLevel.
Outside of SBARINFO this was the biggest remaining piece of code that referenced AInventory internals.
2018-12-02 16:26:02 +01:00
Christoph Oelckers 1f33ba2c4d - fixed incomplete null checks in A_RadiusThrust. 2018-12-02 16:06:04 +01:00
Christoph Oelckers 719598aae4 - scriptified AActor::ClearInventory 2018-12-02 15:24:44 +01:00
Christoph Oelckers 2cb0b2db87 - took the last methods aside from Tick and Serialize out of AInventory. 2018-12-02 14:56:10 +01:00
Christoph Oelckers db814dc333 - properly hook up the alt HUD with the status bar. 2018-12-02 14:34:10 +01:00
Christoph Oelckers d11b33e8fd - scriptified the last components of the alternative HUD.
- moved the ALTHUDCF parser PClass::StaticInit, so that it gets done right after creating the actor definitions.

All left to do is not to reallocate the AltHud object for each frame but store it in a better suited place.
2018-12-02 14:34:10 +01:00
Christoph Oelckers ba905321b0 - scriptified the main drawer for the in-game HUD and removed all intermediate VM calls from the native source. 2018-12-02 14:34:09 +01:00
Christoph Oelckers fe39236ee1 - scriptified the AltHUD'S powerup drawer. 2018-12-02 14:34:09 +01:00
Christoph Oelckers ddaab4d2ab - scriptified and cleaned up the AltHUD's DrawCoordinates, DrawTime and DrawLatency functions.
Some backing functionality was moved elsewhere because scripting should not have access to low level system information.
2018-12-02 14:34:09 +01:00
Christoph Oelckers 4431ec06fd - scriptified the AltHUD's inventory drawer and fixed the InvPrev CCMD. 2018-12-02 14:34:09 +01:00
Christoph Oelckers 714ca9b2ce - scriptified the AltHUD's weapon drawer. 2018-12-02 14:34:08 +01:00
Christoph Oelckers 1406c11f8e - added the missing TNT1A0 check for icon-less keys.
Since it tries to get the icon from the spawn state it also has to check if that actually has a valid sprite.
2018-12-02 14:34:08 +01:00
Christoph Oelckers fbc441673a - AltHUD ammo drawer scriptified. 2018-12-02 14:34:08 +01:00
Christoph Oelckers 0cd93c14af - allow %*d etc. format specifiers in ZScript, but only for numeric types. 2018-12-02 14:34:08 +01:00
Christoph Oelckers 4a1f011dc1 - Alt HUD scriptification, part 1. 2018-12-02 14:34:08 +01:00
Magnus Norddahl edc05111cd - don't use SSE for integer min/max 2018-12-02 09:58:08 +01:00
Magnus Norddahl 706a923884 - Use SSE2 for min/max instead 2018-12-02 07:35:02 +01:00
Major Cooke 49f2a38799 Fixed A_JumpIfNoAmmo not working. 2018-12-02 07:28:20 +01:00
Christoph Oelckers a291ed21fe - fixed the AngleToVector calls in stateprovider.txt.
This looks like a search & replace gone wrong.
2018-12-02 00:41:23 +01:00
Christoph Oelckers c66dae9f2c - this was wrong... 2018-12-02 00:08:19 +01:00
Major Cooke e9df56198c - Restored A_SpawnItemEx's "chance" to "failchance" to prevent mod breakage from named parameters. 2018-12-01 23:39:54 +01:00
Christoph Oelckers 117537339d - fixed script call in PickNewWeapon. 2018-12-01 23:36:48 +01:00
Christoph Oelckers 2d0b90deb1 - fixed: P_Massacre without a class restriction no longer worked. 2018-12-01 22:44:06 +01:00
Christoph Oelckers 577af8860c - scriptified invnext and invprev CCMDs. 2018-12-01 22:37:12 +01:00
Christoph Oelckers 5c647de70c - moved ValidateInvFirst to the script side because this was one of the major functions that directly reference AInventory. 2018-12-01 17:46:20 +01:00
Christoph Oelckers bc1990b6d7 - moved AInventory::DoRespawn fully to the script side. 2018-12-01 17:29:37 +01:00
Christoph Oelckers 3922f817fb - made CallTryPickup a global function.
This one still gets called in too many places but stands in the way of moving Inventory fully to the script side.
2018-12-01 17:21:40 +01:00
Christoph Oelckers 7b63e088e1 - moved the GetBlend script call to the one single place where it is needed to get rid of one native AInventory method. 2018-12-01 17:21:20 +01:00
Christoph Oelckers a14b0c58bf - re-fixed the massacre fix for Dehacked-modified inventory items.
Instead of overriding the Massacre method it is preferable to clear the flags causing the bad behavior, most notably ISMONSTER.

# Conflicts:
#	src/g_inventory/a_pickups.cpp
#	src/g_inventory/a_pickups.h
2018-12-01 17:20:52 +01:00
Christoph Oelckers 7301bbc58e - scriptified GiveAmmo and the one remaining piece of native code still using it. 2018-12-01 17:20:23 +01:00