Commit Graph

2374 Commits (8521b830b2f74b758e434ee7963592958932c281)

Author SHA1 Message Date
lethosor 8521b830b2 Merge remote-tracking branch 'CannibalVox/job_remove' into develop 2016-12-05 15:24:37 -05:00
Stephen Baynham 595f3857b6 Reverse the param order of these two methods
The current way doesn't match other Job module methods
2016-12-01 20:13:49 -08:00
Stephen Baynham 7920f71517 Bad formatting 2016-11-25 00:25:18 -08:00
Stephen Baynham de0e211e07 Figured I could like test my code. 2016-11-24 23:35:03 -08:00
Stephen Baynham e490afdf00 Rebuilt slightly to offer bool return val
We fail on unknown general ref types now, without modifying the job at
all yet
2016-11-24 22:36:11 -08:00
Stephen Baynham 8b964ca2dc Wipe job_items vector 2016-11-21 06:51:21 -08:00
Stephen Baynham fba32f2e2f Also disconnect the job from its items. 2016-11-17 23:25:48 -08:00
Stephen Baynham 67af9f5e82 Add lua bindings for removeJob 2016-11-17 23:04:48 -08:00
Stephen Baynham 74f5df99db Add job remove method
Job remove eliminates a job's worker & holder references, if any, puts
the worker on cd, if appropriate, removes the job's postings, eliminates
the job from the global linked list, and then finally deletes it.  This
code was tested by incorporating it into autochop and it does make the
plugin work.  However, chop jobs don't have holder building references,
and anyway, with DF being 90% edge case by volume, this could use a heck
of a lot more testing.

I saw elsewhere code that prevented worker removal if the job was a
special job, and that made me feel funny so I made the job remove method
not work if the job is a special job.
2016-11-17 19:54:41 -08:00
lethosor ae59b4f5ad Update xml, scripts 2016-11-10 14:25:05 -05:00
lethosor 04ad7a0a42 Replace some instances of "cmake -E copy_if_different" with a standalone script
@JapaMala reported that CMake < 3.5 doesn't support copy_if_different with
multiple source files.

https://cmake.org/cmake/help/v3.5/release/3.5.html#command-line
2016-11-02 16:23:32 -04:00
lethosor 2c230f0d3e Improve protobuf file regeneration (no longer uses a dummy status.txt file) 2016-10-24 22:51:27 -04:00
lethosor 4fdbba0207 Only touch protobuf generated files if they actually changed 2016-10-24 22:28:51 -04:00
lethosor b19a0b4305 Update scripts, xml
Fixes #1005
2016-10-19 09:53:51 -04:00
lethosor b1e3c1088c Give loadfile() result a better name for tracebacks 2016-10-19 09:53:12 -04:00
lethosor 4c21bbd5ae Add Lua::TableInsert() helper 2016-10-15 14:55:48 -04:00
lethosor 8a138fcc4c Avoid polluting global namespace in MapCache.h 2016-10-15 14:53:10 -04:00
Japa b2424f9a59 Merge branch 'develop' of https://github.com/DFHack/dfhack into develop 2016-10-15 10:32:13 +05:30
Japa 08cc9f3188 Cast size_t to int explicitly to avoid compiler warning C4267 2016-10-15 10:31:38 +05:30
Japa 98ab357df0 Use size_t in both path methods, to avoid warning C4267 2016-10-15 10:17:38 +05:30
lethosor 9f541481ea Fix some warnings with GCC -Wall 2016-10-15 00:37:18 -04:00
Japa 980b6dd12f Update XML again. 2016-10-13 19:42:40 +05:30
Japa d5e8b5eeba Update XML 2016-10-13 19:35:40 +05:30
lethosor e6bb7357df Update xml 2016-10-08 17:09:23 -04:00
lethosor f6a91c2f30 Log architecture on startup 2016-10-08 16:58:08 -04:00
lethosor a5338d2f59 Fix rebase_delta type mismatch
See #984. GCC wasn't complaining about this on x64 for some reason.

Also reordered includes.
2016-09-28 20:43:02 -04:00
Quietust 27d2229665 Fix follow_jmp for 64-bit code - skip REX prefix if found 2016-09-25 18:29:57 -05:00
Japa b09ee3407c Merge branch 'v0.43.03' of https://github.com/JapaMala/dfhack into develop
Conflicts:
	library/xml
	plugins/remotefortressreader.cpp
2016-08-29 22:06:37 +05:30
lethosor 41e298bdfc Update submodules 2016-08-27 15:27:57 -04:00
lethosor 85ebbf0e9c Fix df_expr_to_ref for raw userdata 2016-08-24 17:18:55 -04:00
lethosor 6ce470ad57 Add basic lua expression support to memview
Currently just supports basic field accesses (world.x, screen.y.z).
No support for world.x - 4, etc.

Closes #976
2016-08-24 16:26:34 -04:00
lethosor 7487f44fc8 Implement a helper to create lua environments with shortcuts (e.g. scr, unit)
Used in gui/gm-editor and lua

Closes #977
2016-08-23 21:47:41 -04:00
lethosor 2dccd1d0ff Add CheckedArray:__tostring() method 2016-08-22 23:18:30 -04:00
lethosor 1dab45ffed Replace lua_pushnumber with lua_pushinteger in LuaApi.cpp 2016-08-22 23:18:08 -04:00
lethosor e983e66a1a Update xml and scripts 2016-08-21 20:59:24 -04:00
lethosor 70ac99cbfa Fix Buildings::setOwner() persistence
Needed to set bld->owner_id for changes to persist across save/load

Fixes #983, thanks to Quietust
2016-08-21 20:58:40 -04:00
lethosor 98a187ca43 Update xml 2016-08-18 17:28:44 -04:00
lethosor 9e4a6d7591 Update default base address on 64-bit Linux 2016-08-18 17:28:18 -04:00
lethosor 0b6597ddb2 Stop field_offset from crashing due to missing vtables
Now, a pointer to NULL is cast to the type in question, avoiding the need to
call new() or delete() with potentially-misaligned types. Also,
virtual_identity::find has been tweaked to prevent it from crashing on NULL
vtable pointers.

This was suggested by Angavrilov.
2016-08-18 15:59:46 -04:00
lethosor c2997b9c79 Fix save_dir 2016-08-18 15:47:40 -04:00
lethosor de731b0299 Move save_dir back into cur_savegame and update submodules 2016-08-14 12:41:09 -04:00
lethosor e965f5318f Replace many includes with forward declarations in modules/Maps.h 2016-08-13 21:44:01 -04:00
lethosor 576174ea0b Lua: Add lengths of (some) containers to their string representations 2016-08-13 19:52:14 -04:00
lethosor eef6f9bfb7 Add df.new() support for char and unsigned long 2016-08-11 00:01:52 -04:00
lethosor a1ff432bf8 Restore fixed-width types in string representations of lua fields
e.g. tostring(df.new('int16_t')) was returning "<short: 0xaddr>"
2016-08-10 23:58:45 -04:00
lethosor 215afa34f3 Update for 64-bit unit changes
Includes xml, stonesense, scripts

Ref DFHack/df-structures@25cb373
2016-08-10 23:50:00 -04:00
Lethosor 6e741b1a80 Merge pull request #969 from Qartar/win64
Minor fixes/updates for Visual Studio 2015 Win64
2016-08-10 15:15:44 -04:00
lethosor 02eef95147 Fix base address for Darwin x64 2016-08-09 20:00:31 -04:00
lethosor e22b3b1de7 Use non-fixed-width types in integer identity_traits definitions
In some situations (e.g. 32-bit Linux), "intptr_t" is defined as "int", which is
equivalent to "int32_t", leading to issues with duplicate definitions. In other
situations with GCC, "intptr_t" is "long", which isn't covered by any intNN_t
types. Also, definitions for "long" already had to be added on Windows, because
no fixed-width types in MSVC are equivalent to "long".

Switching to non-fixed-width types should hopefully cover all of these
situations. If this doesn't cover any integer types that we need, it will
be caught quickly, e.g. by references to integer_traits<T> in LuaWrapper.cpp.
2016-08-08 11:46:20 -04:00
lethosor 298d16238e Remove a few unneeded includes in DataStaticsFields.cpp 2016-08-08 11:45:00 -04:00