Commit Graph

486 Commits

Author SHA1 Message Date
Enno Rehling a3037950ff fix a bug in the escape_string function.
remove static return variable from escape_string.
add test coverage.
2014-08-24 23:58:31 +02:00
Enno Rehling 920902f8eb replace resource_type::_name array with a single string. 2014-08-24 23:58:30 +02:00
Enno Rehling 4c00777553 make race::_name a string, not an array of strings. add a test for rc_name. 2014-08-24 23:58:29 +02:00
Enno Rehling de5ef3f87b Merge branch 'master' of https://github.com/eressea/server 2014-08-24 17:11:32 +02:00
Enno Rehling 7d17cafdd6 simple tests for build().
cleaning up the code to give it a common setup function.
change the golem code to use flag, not hard-coded race.
unify the golems, make code more readable, kill a block of unused code.
2014-08-24 17:09:32 +02:00
Enno Rehling a1a810a094 segmentation fault 2014-08-24 12:41:39 +02:00
Enno Rehling 1c069da921 segmentation fault caused by new getstrtoken semantics 2014-08-24 12:40:00 +02:00
Enno Rehling 5befbad7c7 Merge branch 'version-3-1'
Conflicts:
	src/laws.c
2014-08-24 00:30:12 +02:00
Enno Rehling f1d78b4b84 fix null-pointer crash. 2014-08-24 00:29:19 +02:00
Enno Rehling 9db6826662 remove unused static function, fix missing include for gcc. 2014-08-23 09:21:40 +02:00
Enno Rehling 808f343e34 make getstrtoken() return null at EOL, kill init_tokens.
init_order all the things!
added a bunch of new assertions to cover for oversights.
added some new tests for order parsing.
2014-08-23 09:17:58 +02:00
Enno Rehling ee2363a4d9 use init_order, it is better than the init_tokens+skip_token pattern.
test for new_units.
additional testing for init_order (renamed from init_command)and init_tokens.
fixed a memory access error when kwd==NOKEYWORD.
2014-08-23 06:45:20 +02:00
Enno Rehling 6b14eae118 Merge remote-tracking branch 'eressea/master'
Conflicts:
	src/kernel/order.c
2014-08-23 06:17:16 +02:00
Enno Rehling beacb850c6 fix MAKE TEMP, for real this time. I hate skip_token and all that stuff. 2014-08-23 00:37:33 +02:00
Enno Rehling b2dc6a3a9d fix MAKE TEMP, for real this time. I hate skip_token and all that stuff. 2014-08-23 00:35:06 +02:00
Enno Rehling dea20e94bd New pre-release. 2014-08-22 07:41:28 +02:00
Enno Rehling fd46b25317 Merge branch 'version-3-0'
Conflicts:
	conf/e3/config.xml
2014-08-22 07:40:43 +02:00
Enno Rehling a84e628522 Repair MAKE, which broke when I changed MAKE TEMP.
You can now also write MAKETEMP as one word, and we treat it that way.
Added unit test coverage for MAKE order parsing.
2014-08-21 07:31:28 +02:00
Enno Rehling aed64a70fb cut the number of allocations for order-data in half.
started writing a test file for orders.
2014-08-21 07:30:50 +02:00
Enno Rehling cc0b0ad71b added a test for addfaction.
removing struct player, since it is not in use.
2014-08-20 23:42:33 +02:00
Enno Rehling 7b3a381500 increase version number to 3.1
log an error when trying to create an order for a disabled keyword
monsters might be trying to TAX in E3?
2014-08-20 19:26:37 +02:00
Enno Rehling 68fc4df74d Configurable monster attack chance, default to 40%.
E3 chance to attack is only 10%.
2014-08-20 11:54:11 +02:00
Enno Rehling fb7c8a898f add a test for get_monsters().
I want to make sure I don't break this in the future.
2014-08-20 08:18:47 +02:00
Enno Rehling 5c7b93d0ce Monster attackieren keine Einheiten in Gebäuden. 2014-08-20 08:18:26 +02:00
Enno Rehling acfe72f24e add a test for get_monsters().
I want to make sure I don't break this in the future.
2014-08-20 07:00:58 +02:00
Enno Rehling e69fb78e6b Monster attackieren keine Einheiten in Gebäuden. 2014-08-19 15:31:16 +02:00
Enno Rehling 3fde10d9e8 Configurable monster attack chance, default to 40%.
E3 chance to attack is only 10%.
2014-08-19 15:24:30 +02:00
Enno Rehling 59ccf23db6 Repair MAKE, which broke when I changed MAKE TEMP.
You can now also write MAKETEMP as one word, and we treat it that way.
Added unit test coverage for MAKE order parsing.
2014-08-17 14:47:39 +02:00
Enno Rehling 99124f3d6d Merge branch 'master' of https://github.com/eressea/server 2014-08-17 07:37:50 +02:00
Enno Rehling b385bfc4d2 Merge branch 'fixes-891'
Conflicts:
	src/kernel/faction.c
2014-08-17 07:23:07 +02:00
Enno Rehling 138a4c10a0 properly create missing monster faction when spawning dragons.
remove cached monster faction (static).
Conflicts:
	src/kernel/faction.c
2014-08-17 07:14:47 +02:00
Enno Rehling 8f09ab73d9 fix display of alliance status, some English translation hiccups. 2014-08-17 00:14:50 +02:00
Enno Rehling cef068fe9b cut the number of allocations for order-data in half.
started writing a test file for orders.
2014-08-16 23:26:31 +02:00
Enno Rehling 8803a9e9a8 properly create missing monster faction when spawning dragons. 2014-08-16 13:46:34 +02:00
Enno Rehling 90ec28fed3 fix missing monster factions. 2014-08-16 13:33:47 +02:00
Enno Rehling fa52bb4192 pointless assert triggers when new units are created and placed.
spawning dragons was causing this to fail.
2014-08-16 13:19:00 +02:00
Enno Rehling 9587e9f0cd remove unused variables 2014-08-16 12:02:45 +02:00
Enno Rehling 2fd085d1e5 Merge branch 'master' of https://github.com/eressea/server 2014-08-16 11:59:20 +02:00
Enno Rehling c79dd33bfb smarter processing of MAKE TEMP.
the order gets its own keyword. parsing is hard - composite commands are an anti-pattern.
this eliminates a lot of unnecessary mallocs for pushing/poping parser state.
2014-08-16 11:41:19 +02:00
Enno Rehling 41d42fa248 localization of alliance status "ALL".
fix for https://bugs.eressea.de/view.php?id=1993
2014-08-16 03:07:37 +02:00
Enno Rehling 61ebd1d6b7 fix accidental assignment instead of comparison. 2014-08-14 20:08:29 +02:00
Enno Rehling fa0c999d3e Merge branch 'Bug-1525-and-1872' of github.com:CTD1/eressea-server-bugfixing into CTD1-Bug-1525-and-1872 2014-08-14 20:06:14 +02:00
Enno Rehling 158d4f8d4b MSVC: compile cleanly with level 4 warnings 2014-08-14 19:39:45 +02:00
Enno Rehling 804734d013 MSVC: disable level 4 warning C4100 for tolua-generated code (unused variable)
make a single object from all generated binding code.
this setup is unusual, but easier to maintain.
2014-08-14 19:39:17 +02:00
CTD 7dd86959a9 Bewegung durch Region blockieren
Etwas größerer Umbau. Befreundete Wachen erlauben nicht mehr automatisch
die Durchreise.  Es werden sowohl die Befreundeten als auch die
Feindlichen Bewacher in der Region gezählt, und die Differenz mit
rules.guard.guard_number_stop_prob multipliziert. Bei 700 Feindlichen
und keinen freundlichen Wachen ist die Chance dann 100%. Bei 100
Feindlichen und 400 freundlichen ist sie 0.
Zusätzlich gibt rules.guard.castle_stop_prob 10% pro Burgenlevel für den
Burgenbesitzer.
rules.guard.region_type_stop_prob gibt 10% für Regionen mit weniger
Begehbaren Pfaden (Berge und Vulkane) und das doppelte für sehr schwer
passierbare Regionen (Sümpfe und Gletscher).

Für Spiele mit Wahrnehmung (E2) sollten die Werte für:
rules.guard.skill_stop_prob
rules.guard.castle_stop_prob
rules.guard.region_type_stop_prob

auf 5% Angepasst werden.
2014-08-14 12:37:59 +02:00
Enno Rehling ff73358b9c Some tiny errors that slipped through Visual Studio's warnings. 2014-08-14 09:59:33 +02:00
Enno Rehling dafe71f4b8 micro optimizations.
removing a lot of mallocs through strdup  by replacing getcommand calls with get_command, which takes a buffer. only one left.
removing mkname calls with a static buffer for keyword-tokens.
commit the schema file I had lying around.
2014-08-14 09:57:05 +02:00
Enno Rehling 9ca206ec3f remove reference to thieves and spies from this spell for non-E2 games.
this fixes https://bugs.eressea.de/view.php?id=1548
2014-08-14 07:05:12 +02:00
Enno Rehling 38352ef3bf add the build number to saves.
this should make future debugging sessions easier, telling us what bugs were or were not fixed at the time of an incident.
added a test to make sure data file can be read/written, and at a minimum, sets global data-version.
also clean up test framework a bit, and introduce a helpful macro.
2014-08-14 05:06:36 +02:00
CTD bdbffba68e Fixing Merge conflict 2014-08-14 02:06:24 +02:00