Commit graph

190 commits

Author SHA1 Message Date
LJ Sonic
bc9a378521 Refactor userdata metatable registration 2023-10-27 20:17:27 +02:00
Lactozilla
6414e9db79 Fix possible crashes in the Lua API when accessing invalid fields 2023-08-31 15:02:59 -03:00
GoldenTails
4212035729 Fix errors due to declaring variables in switch bodies 2023-07-24 21:44:53 -05:00
Nev3r
3338d7ca74 Merge branch 'conversion-context-drift' into 'next'
UDMF context drift fixes

See merge request STJr/SRB2!2061
2023-07-24 12:49:14 +00:00
toaster
66dd952fdd Tidier conversion of string properties on linedefs to UDMF
Previously, many concatenated texture field strings were turned to text, then had that string run through get_number, then had it converted back into a string to become a stringarg.

Now, the concatenated string is copied directly to the relevant stringarg, with no intermediary steps.

This fixes an issue where a map with object or state properties would have "context drift" - breaking when the object or state list changed, due to differently ordered freeslots, or new hardcoded objects.

Affected types:
- doomednum 1110/Action 9 (Custom Mace/Chain)
- doomednum 700 and those immediately following (Ambient Sound)
- Action 4 and 414 (dash pad, play sound effect)
- Action 14 (bustable block parameters)
- Action 434 (Award Power)
- doomednum 757/Action 15 (fan particle generator)
- doomednum 1202 (bumpable hazard rock/apple spawner)
    - This one has undefined behaviour in the binary map format which was not previously forbidden. This undefined behaviour is EXTREMELY vulnerable to context drift, and so it's simply not worth creating a system to write numerical values into object types - we write an explicit name only for the intended range, and otherwise report the threat of context drift when converting.

In addition, to reduce duplicated zone memory, (sidedef_t).text and (linedef_t).text have been removed from all but the Lua API. In Lua, in binary maps, they point to the host line's stringargs - the line's text and a frontside's text will return stringargs[0], while a backside's text will return stringargs[1]. I've done my best to match the previous API as closely possible, to the point of reporting false nils if the line didn't previously have text available.

However, there are four linedef Actions for which the sidedef text will be different between builds containing and not containing this commit - 331, 332, 333 (the Character-specific linedef executors), and 443 (Call Lua Script), and only if the text is long enough to go over two lines. Given that both halves would be incomplete nonsense in this case, I'm willing to wager this minor point of discrepancy is not a breaking issue.
2023-07-20 19:42:21 +01:00
Ace Lite
2240742720 Merge branch SRB2:next into lua-texture-offsets-expose 2023-07-06 18:35:00 +00:00
MascaraSnake
8c31d279cf Implement per-texture offsets in UDMF 2023-06-28 01:07:52 +02:00
Gustaf Alhäll
2f2de7d3d3
Optimize field lookups in Lua metatables 2023-06-18 18:05:16 +02:00
MascaraSnake
16ad23f06d Fix flag mixup in P_GetOldFOFFlags() 2023-04-10 14:08:53 +02:00
spherallic
1470d099e3 Update copyright year & credits 2023-03-31 14:53:31 +02:00
Ace Lite
da9786b593 exposed floorlightsec, ceilinglightsec variables. 2022-11-25 23:16:11 +00:00
Ace Lite
3217984f55 c-side offset/angle variable renamed 2022-11-25 23:01:27 +00:00
Ace Lite
9d4a3b91c3 change names of Lua variables for last time. 2022-11-25 22:27:41 +00:00
Ace Lite
27c6afb80b Yikes. how did I miss "_" on every single variable 2022-11-24 18:51:53 +00:00
Ace Lite
e789bf1fb2 Fix for consistency
just *angle for *_angle
2022-11-23 17:29:44 +00:00
Ace Lite
34cc1d1cc4 Exposed floor/ceiling pic x/y offsets to Lua. 2022-11-23 17:09:54 +00:00
MascaraSnake
7389e2ceb6 Use the correct bustflags constant 2022-07-31 13:24:45 +02:00
MascaraSnake
1049eca15e Forgot to add fofflags to ffloor_opt 2022-07-31 13:01:45 +02:00
MascaraSnake
8d4baace53 Add Lua backwards compatibility for FOF flags 2022-07-31 12:04:42 +02:00
MascaraSnake
5fbe5189ce Merge branch 'udmf-sector-fields' into udmf-full 2022-04-20 21:01:52 +02:00
MascaraSnake
faa7d89e3e Merge branch 'udmf-more-linedef-types' into udmf-sector-fields 2022-04-20 21:01:16 +02:00
MascaraSnake
2e56c3de35 Merge branch 'udmf-polyobjects' into udmf-lighting 2022-04-19 22:18:30 +02:00
MascaraSnake
0b4bbacec0 Merge branch 'next' into udmf-fofs-mkii 2022-04-19 21:59:31 +02:00
sphere
55854410ac Merge branch 'line-angle' into 'next'
Add angle field to linedef_t

See merge request STJr/SRB2!1602
2022-03-22 09:09:40 +00:00
MascaraSnake
a78e4e553c Merge branch 'next' into udmf-fofs-mkii 2022-03-18 07:29:02 +01:00
spherallic
14295ac7de 2022 2022-03-03 20:24:46 +01:00
MascaraSnake
a342703b50 Merge branch 'udmf-sector-fields' into udmf-full
# Conflicts:
#	src/lua_maplib.c
#	src/p_setup.c
2022-01-14 21:16:23 +01:00
MascaraSnake
13b8d1cf7e Merge branch 'udmf-more-linedef-types' into udmf-sector-fields 2022-01-14 21:09:11 +01:00
MascaraSnake
79cf2f53e8 Merge branch 'udmf-polyobjects' into udmf-lighting 2022-01-14 20:24:51 +01:00
MascaraSnake
6bb6dc88ca Merge branch 'next' into udmf-fofs-mkii
# Conflicts:
#	src/hardware/hw_main.c
#	src/lua_maplib.c
#	src/p_spec.c
#	src/p_user.c
2022-01-14 07:24:05 +01:00
MascaraSnake
b6a5ff98f0 Merge branch 'udmf-sector-fields' into udmf-full 2022-01-07 12:46:47 +01:00
MascaraSnake
577ae68d6d Make sector friction a floating-point field 2022-01-04 21:25:34 +01:00
MascaraSnake
913731b4bc Merge branch 'blentran-update' into udmf-full
# Conflicts:
#	src/lua_maplib.c
#	src/p_setup.c
#	src/p_spec.c
2022-01-02 23:19:47 +01:00
MascaraSnake
208395214a Implement sector fields for linedef executor triggering 2021-12-31 11:39:34 +01:00
MascaraSnake
b3be8d1f44 Implement sector damagetype field 2021-12-31 08:53:00 +01:00
MascaraSnake
feaa4f1273 Replace most sector specials with sector special flags 2021-12-31 00:03:24 +01:00
MascaraSnake
b3863c57be Replace verticalflip in sector_t with a sector flag that's accessible via Lua and UDMF 2021-12-30 18:50:02 +01:00
MascaraSnake
86e2fefcac Add sector gravity field for UDMF 2021-12-30 18:19:42 +01:00
MascaraSnake
e3d41e0bda Adapt linedef type 540 to UDMF 2021-12-30 15:32:28 +01:00
MascaraSnake
2fd6eafbcf Expose sector flags to Lua and UDMF 2021-12-30 14:16:00 +01:00
sphere
7601afb6c1 blentran part 3: Wall & plane blendmodes. 2021-12-05 00:48:21 +01:00
MascaraSnake
aee4996eba Merge branch 'udmf-polyobjects' into udmf-lighting 2021-12-03 19:22:37 +01:00
MascaraSnake
6dc49042de Port katsy's bouncy FOF cleanup 2021-12-03 18:48:16 +01:00
MascaraSnake
e43831bedb Expose floor/ceiling lighting to Lua 2021-09-19 09:06:39 +02:00
GoldenTails
72bf2a9897 Add angle field to linedef_t 2021-08-24 03:13:18 -05:00
MascaraSnake
23efeeed8e Merge branch 'next' into udmf-fofs-mkii 2021-06-23 19:48:26 +02:00
LJ Sonic
d325c7e6d3 The year is 2021 2021-05-07 17:45:56 +02:00
LJ Sonic
efdfa55328 Remove misleading comment 2021-03-12 19:54:01 +01:00
LJ Sonic
75d0e70236 Fix sector tags being signed in Lua 2021-02-25 23:41:43 +01:00
Nev3r
b642682dde Merge branch 'next' of https://git.do.srb2.org/STJr/SRB2 into lua-tag-iterator
# Conflicts:
#	src/doomtype.h
2020-12-16 17:27:44 +01:00