This allows one to use the C4Value constructor instead of
C4ValueConv. To avoid unintended implicit conversions like
const char * to bool, add a private template constructor that
catches everything not in the list of intended constructors.
The C4AulScript containing the source of the function was already mostly
used to get the relevant proplist or available from context. This will
allow more than one proplist plus the global one per scripthost to contain
functions.
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.
For the updated source files, the timeline has been split into three
parts:
1. Pre-RWD code (before 2001)
2. RWD code (2001 through 2009)
3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
C4StringTable::RegString modifies the provided StdStrBuf. Use FindString
instead, since GetPropertyByS reliably returns failure for a
freshly-registered string anyway.
excNotFound is used to signal that the end of a list is reached. But these
error conditions in C4Value::CompileFunc signal some logic error, not
finding an end-of-list marker instead of a C4Value.
For example, the proplist in Clonk.ActMap.Walk is saved as DClonk.ActMap.Walk.
Should the script defining the proplist change while the savegame is stored,
the proplist will have the new contents instead of the old ones after savegame
load.
Also, save functions as DFlint.Hit instead of fDFlint.Hit. Loading uses the same
code as static proplist loading.
Curiously, this makes g++ 4.4 use the C4RefCntPointer move constructor,
which was broken until now. Fix it to take a mutable rvalue reference.
This was probably broken by the C4V_Any/C4V_Nil separation. Also clean
the function up a bit and add an assert that should catch similar stuff in
the future.
When that value was copied it went from Enum 0 to nil. While this could
be fixed by making C4V_Enum a NullableType, counting from 1 is a tiny bit
less code overall.
This is done with the new C4ValueNumbers class. Every array and proplist
with the exception of objects, definitions and effects gets a number
when the game is saved and is restored via that number on load.
There's no need to go through the entire object list to get an object
number, so convert most usages of ObjectNumber(obj) with obj->Number. Add a
new method to check proplist pointers for debugging purposes to
C4PropListNumbered.