summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/clua.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove stuffNicholas Feinberg2014-07-291-1/+2
| | | | | | | .cc, moving its contents into the new stepdown.cc and strings.cc. (The latter also got many donations from libutil.h.) Down with stuff! Up the new flesh!
* Move frombool() from stuff.cc -> clua.ccreaverb2014-07-281-1/+6
|
* Move a function (tobool, 2 args) from stuff.cc -> clua.ccreaverb2014-07-281-1/+15
|
* Add end.ccNicholas Feinberg2014-07-281-0/+1
|
* Rearrange some comments.Neil Moore2014-06-041-4/+4
|
* Allow using Luajit on 64-bit systems (#8641)Neil Moore2014-06-041-0/+21
| | | | | | | 64-bit luajit doesn't support lua_newstate or custom allocators, so don't try to use one there. However, give a warning if this happens with a webtiles or dgamelaunch build, because servers probably do want the memory throttling.
* More formatting fixes for return (...);Neil Moore2013-11-151-3/+3
|
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-2/+2
|
* Don't allocate pointless iterators.Adam Borowski2013-11-151-1/+1
| | | | | map or set.count() can test the presence of a given key and return 0 or 1 outright.
* New clua functions spells.range and spells.mana_costNaruni2013-08-281-0/+1
|
* Port to OpenSolaris (Dyson/Illumos).Adam Borowski2013-05-051-3/+3
| | | | | | This might be portability for portability sake (Solaris is so dead), but come on, we can't disappoint Igor Pashev by porting our stuff later than several hours after the first installable build of Dyson is released :)
* Use std namespace.Raphael Langella2012-08-261-30/+28
| | | | | | | | | | | | | I had to rename distance() (in coord.h) to distance2() because it conflicts with the STL function to compare 2 iterators. Not a bad change given how it returns the square of the distance anyway. I also had to rename the message global variable (in message.cc) to buffer. I tried to fix and improve the coding style has much as I could, but I probably missed a few given how huge and tedious it is. I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool and util/levcomp.*, because I have no clue about those.
* Drop a bunch of parentheses from return statements.Adam Borowski2012-08-081-1/+1
| | | | | This is incomplete, partially because of me getting bored, partially because of doubts about the point of leaving simple addition/etc in parentheses.
* Massive style fix (braces, indentation, etc.)Neil Moore2012-08-011-0/+2
|
* Some more return deparenthesization.Adam Borowski2012-07-051-5/+5
|
* Remove parentheses around return (simple_function_call).Adam Borowski2012-07-051-9/+9
| | | | For way too paranoid and underinclusive values of "simple".
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-35/+35
|
* Hardcode the loading of {stash,wield,runrest,gearset,trapwalk,autofight}.luaAdam Borowski2012-06-191-1/+2
| | | | | | | | | | | | | You are free to not use their functionality, load a private modified version, etc, leaving the default version dormant -- and harmless. This removes the need to manually update your config whenever such a lua file is removed or added. They are a part of the game itself now, being written in lua is a hidden implementation detail. There is one file left: lua/kills.lua, it produces spammy dumps not everyone wants. Perhaps it should be always loaded, but disabled unless someone uses an option?
* Use ARRAYSZ() instead of sizeof division, for readability.Adam Borowski2012-06-191-3/+2
| | | | Also, it's not vulnerable to changes to the underlying types.
* Solve minor tag name issue for Lua marker compatibility.Jude Brown2011-11-111-0/+1
| | | | | | | | | | | | | | util/gen_luatags.py will now generate dat/dlua/tags.lua. It's pretty simplistic at the minute -- just mapping the relevant TAG_MINOR_XXX to a numeric value. This is obviously not automated, and will need to be run whenever you update tag-version.h /and/ wish to be able to access one of those tags from Lua. It could do more fancy things, I suppose, but having it simple for now solves a relatively minor issue which could, in theory, become more prevalent if or when we start modifying markers more regularly. At the very least, it means we don't need to bump the major version every time I change a fog machine parameter.
* Rename dat/clua to dat/dlua to avoid the clua/dlua confusion.Adam Borowski2011-06-181-5/+5
| | | | | There might be places where dlua is referred to as clua internally, and in many places "clua" means "lua in general".
* Don't cast to longs literals that are not long.Adam Borowski2011-06-071-1/+1
|
* Doxygenization and junk purging that was missed by my script.Adam Borowski2011-04-021-5/+0
|
* Merge branch 'master' into unicodeAdam Borowski2011-01-111-1/+1
|\ | | | | | | Conflicts galore...
| * Use die() instead of ASSERT("...").Vsevolod Kozlov2011-01-111-1/+1
| | | | | | | | | | ASSERT("...") never fails, but let's pretend that in these cases, a failure (as produced by die()) is intended.
* | Stop lua from adding [string "%s"] to error messages. (greensnark)Adam Borowski2010-12-181-1/+3
| |
* | Allow lua files with a BOM -- including Windowsish 16 bit encodings.Adam Borowski2010-12-161-1/+8
| | | | | | | | | | | | | | REGRESSION: errors say: Lua error: [string "/home/kilobyte/crawl/crawl-ref/source/meow"]:2: moo rather than Lua error: /home/kilobyte/crawl-0.7/crawl-ref/source/meow:2: moo
* | Merge branch 'master' into unicodeAdam Borowski2010-10-151-10/+10
|\|
| * Massive spacing fixes: "( spaces after parentheses )".Adam Borowski2010-10-151-10/+10
| | | | | | | | | | | | I did review it manually to find places where they made sense (like some tables), but for a massive sed job like this there might be places that I missed.
* | Handle filenames with non-ascii characters.Adam Borowski2010-09-171-1/+2
|/ | | | | Only iostreams functions are left; on Windows they don't support Unicode so a workaround will be needed.
* Merge branch 'save-package'Adam Borowski2010-09-061-5/+4
|\
| * Store the "lua" subfile as a chunk.Adam Borowski2010-09-041-5/+4
| |
* | Rename class "monsters" to "monster".Robert Vollmert2010-09-051-1/+1
|/
* Get rid of more longs and all "%ld"s, new gcc + Windows + them = bad mojo.Adam Borowski2010-07-161-3/+3
|
* Disallow longs in the Lua interface.Adam Borowski2010-06-201-0/+1
|
* Make Crawl react better to seeing des files and database text files modified ↵Darshan Shaligram2010-06-141-2/+3
| | | | | | | | | | | | | | | | | | and recompiled by new Crawl processes while older processes are running. When mapdef.cc detects that a .dsc file is out of sync, it throws an exception that dungeon.cc catches. dungeon.cc then discards all loaded maps and reloads then from the map index (.idx) files. The old behaviour was to create a panic save and exit for out-of-sync .dsc files, which is not ideal since the panic save code is rarely used and tends to bitrot. When regenerating text database files in DGL installs, the game no longer unlinks the old .db file, and will instead update the old file with the new db keys. None of this code should be relevant to single-user installs.
* Free memory used for Lua chunks after compiling .des files. This ↵Darshan Shaligram2010-06-131-0/+5
| | | | considerably reduces heap use in the first Crawl process to run in a fresh install.
* Remove EOL.Robert Vollmert2010-03-111-3/+3
| | | | | | | | | | | We were only setting it to "\r\n" on DOS, but according to commens in #1045, DOS will translate "\n" to "\r\n" automatically for text output. Also, the DOS EOL handling was likely broken anyway looking at how a lot of the linebreaking code only considered "\n". Fixes issue #1045.
* Allow passing of monster_info arguments via CLua::push_args.Robert Vollmert2010-02-051-0/+3
| | | | These are marked as 'I'.
* Fix broken pickup.lua (78291).Darshan Shaligram2010-01-251-0/+3
| | | | The pickup code was pushing item_defs as lightuserdata instead of a wrapped item userdata, and item.can_cut_meat() should have been written item.can_cut_meat.
* Throw a Lua error instead of killing Crawl if a Lua state does not have a ↵Darshan Shaligram2010-01-241-1/+1
| | | | known matching clua (this can happen when coroutines are involved).
* Fix stash-tracker item annotations and restrict user scripts to access items ↵Darshan Shaligram2010-01-241-1/+1
| | | | only on the same turn the items were wrapped for Lua by the core C++ code.
* Replace static snprintf() with make_sprintf() where the result is ↵Adam Borowski2009-12-171-3/+1
| | | | | | immediately cast to std::string.
* Fix another callmbooleanfn bug.Robert Vollmert2009-11-241-1/+1
|
* Fix compile with newer gcc.Robert Vollmert2009-11-241-3/+3
|
* Add "maybe_bool CLua::callmbooleanfn".Robert Vollmert2009-11-241-8/+22
| | | | This allows Lua hooks to say they don't have an opinion.
* dat/clua/iter.lua: iterators for Lua.Jude Brown2009-11-191-0/+1
| | | | | | | | | | | | | | | | | | Currently only includes: rectangle_iterator: iterates points between two corners. los_iterator: iterates over currently visible points in LOS. adjacent_iterator: iterates over adjacent points to the center. Most iterators accept a "filter" parameter that is a function which should either return true if the point is acceptable for the iteration, or false if it is not. los_iterator is currently restricted to player LOS rather than actor or monster LOS, but could be expanded at a later date. All of the iterators seem to work as intended: hopefully I haven't made too many mistakes with them.
* set_exclude/del_exclude lua bindings.Robert Vollmert2009-11-121-0/+1
|
* lmark.synchronized_markers(): apply one marker's effects to multiple points ↵Darshan Shaligram2009-10-311-5/+45
| | | | | | | | | | | | | | | simultaneously. synchronized_markers() takes a marker, and a list of method names to override, and returns a set of markers that fire simultaneously, to allow, say, fog machines that fire at random intervals, but always fire in unison. lm_mslav.lua has details. volcano.des has an example volcano entry vault that uses this. Allow fetching a list of Lua markers/marker positions by property value. Renamed dgn.find_marker_prop -> dgn.find_marker_position_by_prop. s/helper/listener/ for fog machine listeners.
* Add whitespace fixes.David Lawrence Ramsey2009-10-311-1/+1
|