Commit graph

35 commits

Author SHA1 Message Date
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
James R
8701caa110 Merge branch 'blua-urite' into 'next'
Fix crash when trying to use bitwise NOT on true/false/nil

See merge request STJr/SRB2!1262
2020-12-10 15:03:39 -05:00
James R
621efbfa15 Lua taglib for accessing taggroups
The global "tags" can be iterated upon for every unique tag which is set in the
level. If a tag is set on a sector/line/thing, it will be included. Taking the
length of "tags" will give you the number of these unique tags. (If a tag is
set on multiple sectors/lines/things, it will only be counted once though.)

For sectors, lines and mapthings, call the field "tagged". This function takes
one argument, which is the tag. The return value can be iterated over for all
the sectors/lines/things with that tag. The length can also be taken for the
number of such objects. If no argument is given, the global tag is default.
2020-12-04 00:30:08 -08:00
James R
5a8e653cd5 More concise 2020-11-21 13:43:32 -08:00
James R
377a9c10f0 Lua: disallow bitwise not on anything but number values
This fixes a crash.
2020-11-21 13:37:45 -08:00
Louis-Antoine
01124f2076 Fix Lua stacktrace not showing in various situations 2020-11-13 19:12:25 +01:00
James R
bd9fda8ceb Merge branch 'lua-polyobjects' into 'next'
Lua polyobjects

Closes #19

See merge request STJr/SRB2!1140
2020-10-15 19:08:54 -04:00
Steel Titanium
16569b4e9a Make "divide by zero" or "modulo by zero" errors show the file and line of where it happened
Shouldn't break scripts as it stops execution as soon it happens, like it already does.
2020-09-14 22:54:07 -04:00
GoldenTails
c61eeb9238 Can we just do this please? Thanks. 2020-09-09 22:19:14 -05:00
Monster Iestyn
d5beae9738 Begin work on adding access to polyobjects in Lua:
* create new file lua_polyobjlib.c
* made a stub LUA_PolyObjLib function
* added META_POLYOBJ to lua_libs.h
* updated makefile, CMake and MSVC project files for lua_polyobjlib.c
2020-09-08 18:08:08 +01:00
Nev3r
2322644488 Merge branch 'dofile' into 'next'
Add dofile() to Lua

See merge request STJr/SRB2!969
2020-06-12 02:32:16 -04:00
Louis-Antoine
1dbb755743 Add dofile() to Lua 2020-05-29 17:35:07 +02:00
Louis-Antoine
c8948909d3 Fix I_Error when queuing multiple Lua files 2020-05-19 23:50:37 +02:00
Louis-Antoine
f620b52672 Fix sending Lua files in text mode 2020-05-19 21:36:21 +02:00
Louis-Antoine
06d3af6716 Refactor Lua file transfer code 2020-05-19 15:16:51 +02:00
Louis-Antoine
e3cbdf8fab Use HAVE_BLUA as fuel for my fireplace 2020-03-19 18:36:14 +01:00
Louis-Antoine
7ba93c184f Fix warning and formatting 2020-03-02 13:33:12 +01:00
James R
cce5308108 Fix compiler warnings 2020-02-20 17:18:26 -08:00
Louis-Antoine
2d142f734f Remove all potentially dangerous functions
Basically any function that calls fopen() is gone,
except the ones created by me.

And no access to stdin/stdout/stderr
through io.read()/io.write().
Not really harmful but why would you want that in SRB2.
2020-01-25 01:37:50 +01:00
Louis-Antoine
16c7981bb8 Fix the compiler warning fix 2020-01-24 23:34:39 +01:00
Louis-Antoine
51947319ee Fix two compiler warnings 2020-01-24 23:24:54 +01:00
Louis-Antoine
9658ef2c5b Add .dat and .csv to whitelisted file extensions 2020-01-24 17:51:20 +01:00
Louis-Antoine
e0f0984fcc Rename "luafiles/shared/" to "luafiles/client/" 2020-01-24 17:11:00 +01:00
Louis-Antoine
3b22a84296 Split open() into open() and openlocal()
open() for normal, consistency-friendly reading,
openlocal() for writing and local reading.
2020-01-24 02:47:51 +01:00
Louis-Antoine
e8760fe5dd Update Lua I/O support to 2.2 2020-01-22 23:08:57 +01:00
Alam Ed Arias
f1a347e55f Merge branch 'public_next' into master 2017-09-28 11:01:20 -04:00
Alam Ed Arias
2ccd397d11 Build: kill GCC 7's implicit-fallthrough warning 2017-09-28 09:39:47 -04:00
Monster Iestyn
dc1e7165f7 Created lua_blockmaplib.c, for Lua's blockmap library
my P_SearchBlockmap_* functions are now a single searchBlockmap function, you can choose between "objects" and "lines" with the first arg to decide what to iterate through. I also rearranged the argument order a bit for easy stack cleanup etc

I'll remove the old stuff later, don't worry, it's disabled for now
2016-10-27 18:10:30 +01:00
Alam Ed Arias
2c8008e11e NULL checks 2016-06-13 10:07:10 -04:00
Alam Ed Arias
209d76cb9d gcc-6: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] 2016-05-28 21:24:06 -04:00
Alam Ed Arias
35f36e1bba travis-ci: set v of nulK to 0 2016-05-28 19:28:37 -04:00
Yukita Mayako
120c9c5ad5 Change int32_t to __int32 on MSC.
I can't just say screw it and include the full
doomtype.h here (windows.h conflict?) so a
small hack here will have to do. :I
2015-06-10 07:41:44 -04:00
JTE
ef0e61fc33 Change LUA_NUMBER to fixed_t, change angle_t handling in Lua.
Angles now go from 0 to 0xFFFF (360 degrees == FRACUNIT) instead
of using a full UINT32. Lua only has one number type, so signedness
gets in the way of using angle_t directly. This handling of angles
matches up with how ZDoom ACS scripting and the like does it.

I also changed all the integer casts and pushes of fixed_t to
their own macro in preperation for possible future seperation.
2015-05-20 23:54:04 -04:00
Alam Ed Arias
404b5f666c SRB2 2.1.12 release 2014-11-11 19:55:07 -05:00
Alam Ed Arias
b93cb1b65a SRB2 2.1 release 2014-03-15 13:11:35 -04:00