Commit graph

384 commits

Author SHA1 Message Date
Enno Rehling
153039fdef fix gcc compilation, unused variable 2017-05-24 08:58:46 +02:00
Enno Rehling
18daa9db2f entirely remove RC_SPELL 2017-05-24 08:52:19 +02:00
Enno Rehling
c8e777c6d4 Merge branch 'bug2211_addendum' of https://github.com/stm2/server into stm2-bug2211_addendum 2017-05-21 14:51:13 +02:00
Enno Rehling
d9fca4dcb3 refactor stray fptr variable into callbacks module. 2017-05-08 22:44:18 +02:00
Enno Rehling
bf935f5bb7 gamedate: no negative turns allowed.
feed the beast assert.
2017-05-07 16:12:10 +02:00
Enno Rehling
3b9a6e45a1 turns out: btype->age is never used. 2017-04-29 13:53:28 +02:00
Enno Rehling
51c2df62ca fixing new coverity scan defects
167039 Dereference after null check
167038 Unchecked return value
2017-04-16 15:52:34 +02:00
Enno Rehling
d99090ac67 remove additional unused macro constants 2017-03-31 21:29:37 +02:00
Enno Rehling
03653a7338 fix two live warnings (unicode trim and fleechance registration) 2017-03-27 18:07:44 +02:00
Enno Rehling
4c21ff5d63 BUG 2311: enforce all unit limits. 2017-03-11 20:30:17 +01:00
Enno Rehling
21e260907c BUG 2311: unit limits were not enforced by GIVE. 2017-03-11 20:03:49 +01:00
Enno Rehling
d633c2a9fb BUG 2310: counting units and people.
reduce number of count_all loops made,
make f->num_units and f->num_people be correct.
2017-03-11 19:36:26 +01:00
Enno Rehling
0f2744fcf3 BUG 2285: remove factions' wealthfrom statistics. 2017-03-11 18:10:23 +01:00
Enno Rehling
858074501e additional comments 2017-03-11 16:37:54 +01:00
Enno Rehling
4d07782e7d Merge branch 'master' into develop
Conflicts:
	scripts/tests/e2/init.lua
	scripts/tests/e3/init.lua
	src/economy.c
	src/economy.test.c
2017-03-06 06:27:31 +01:00
Enno Rehling
a265bc9cdb test giving stuff to 0. 2017-03-03 18:03:34 +01:00
Enno Rehling
45854851ae bug 2292: allow packice to be guarded again.
https://bugs.eressea.de/view.php?id=2292
2017-03-02 18:08:58 +01:00
Enno Rehling
3cb24299fa bug 2292: only land regions can be guarded.
https://bugs.eressea.de/view.php?id=2292
Also adding tests for every other failure reason.
2017-03-02 12:39:21 +01:00
Enno Rehling
9d09574d5e enable process_orders to be done in steps.
by checking before turn_end(), we can sense temporary attributes and curses on a unit before they age away.
2017-02-27 19:35:14 +01:00
Enno Rehling
44c3838d79 WIP: itype->use elimination. 2017-02-27 04:22:28 +01:00
Enno Rehling
b8ffc20d87 remove item_useonother callbacks (use is fine).
add a test for foolpotion.
2017-02-26 19:54:58 +01:00
Enno Rehling
bfb5a9b692 set age_unit and name_unit funpointers in rc_create.
no more <function/> in XML races.
rename juju-zombie => juju.
2017-02-20 22:07:36 +01:00
Enno Rehling
4e5f1d05ce Be very strict about C standards.
Compile with -std=c89 in gcc.
remove all // comments (they are nice, but unnecessary).
variables only declared at start of block.
various pedantery.
backwards compatible va_copy for pre-C99 gcc.
2017-02-18 21:15:14 +01:00
Enno Rehling
fd9583df3d fix healing for elves in a forest.
rename _magres back to magres.
rc->parameters is not linked to config_changed invalidation.
add tests.
2017-02-03 17:43:40 +01:00
Enno Rehling
21514f3bfe BESCHREIBE REGION ist jeder Einheit des Regionsbesitzers erlaubt 2017-01-26 18:06:49 +01:00
Enno Rehling
2a1ead6506 BENENNE REGION ist jeder Einheit des Regionsbesitzers erlaubt 2017-01-26 18:06:49 +01:00
Enno Rehling
c0692986b2 make runtests.bat not crash.
disable auto-load of config.lua (sob).
free messages and config in config.reset().
2017-01-26 18:06:48 +01:00
Enno Rehling
48ae12b629 emit a password message for newbie factions 2017-01-26 18:06:16 +01:00
Enno Rehling
d94cde67a4 kill autoconf.h, replace platform.h for C99 compatibility work 2017-01-26 18:03:48 +01:00
Enno Rehling
f297d89958 merge monster.c and monsters.c
move RCF_DESERT handling to monsters.c
2017-01-26 17:57:21 +01:00
Enno Rehling
a4badc0a75 remove quicklist shim, use selist everywhere 2017-01-26 17:41:21 +01:00
Enno Rehling
7f9313f1a7 static analysis warnings.
PVS-Studio warnings reduced or suppressed.
2016-11-23 18:56:40 +01:00
Enno Rehling
ec4060cb9a fix curse-vigour calculation math.
also fix a ton of small other niggles from pvs-studio.
2016-11-20 19:08:39 +01:00
Enno Rehling
303eb86399 factionid and curseid are also boring. 2016-11-17 21:29:15 +01:00
Enno Rehling
a88bfa7a9a decluttering config.c (rules go into laws.c) 2016-11-16 22:46:01 +01:00
Enno Rehling
17365edff7 move renumber command to a separate module. 2016-11-15 23:34:20 +01:00
Enno Rehling
772bc427aa Merge branch 'develop' of github.com:ennorehling/eressea into develop 2016-11-15 20:44:02 +01:00
Enno Rehling
c1f468ceb0 begin to declutter config.c 2016-11-15 20:43:36 +01:00
Enno Rehling
ce4a3c14b3 convert from atoi to atoip.
most numbers in commands cannot be negative.
2016-11-14 22:27:44 +01:00
Enno Rehling
11b122048b reduce dependency on save.h
moving a_write* functions to attrib.h, which was most of the reason everyone and their mom include save.h
2016-11-13 19:40:38 +01:00
Enno Rehling
ff09defa69 prevent badly naming units/factions/regions. 2016-11-11 01:59:43 +01:00
Enno Rehling
03d90c5680 remove BOM from UTF-8 files, replace Umlauts 2016-11-01 17:25:52 +01:00
Enno Rehling
754ad78db7 WIP: remove GUARD_* flags.
TODO: does not compile
TODO: write new guard.test.c tests
2016-10-31 07:45:06 +01:00
Enno Rehling
1ea8c80845 test that is_guard changes when armedmen does. 2016-10-29 19:19:11 +02:00
Enno Rehling
8f802c11e1 off-by-one error for early break from loop. 2016-10-25 00:12:18 +02:00
Enno Rehling
f12eda8bdf remove cfindhash, again.
curse and unit ids can collide, there is no reason why they should be from the same pool.
2016-10-23 10:03:33 +02:00
Enno Rehling
63f60a2465 cache some more get_race calls, especially for RC_SPELL. 2016-10-03 20:36:46 +02:00
Enno Rehling
e45dc3d68a initizlize rc_elf 2016-09-22 09:37:54 +02:00
Enno Rehling
ff83d5108a remove old_race call form heal_factor 2016-09-22 09:08:02 +02:00
Enno Rehling
a3ad9a0222 I am now calling get_race far too often. Fix this a bit. 2016-09-20 20:27:41 +02:00
Enno Rehling
aceb880826 add some TODO and reduce old_race usage. 2016-09-19 18:45:16 +02:00
Enno Rehling
86ef225ccb add some more local caching. 2016-09-11 12:48:00 +02:00
Enno Rehling
a5ce809f41 fix memory leak in umlaut.c with reference counting (sad). 2016-09-06 19:57:07 +01:00
Enno Rehling
d9e541843b further reduce number of bt_find calls. 2016-08-30 09:36:09 +01:00
Enno Rehling
1a1ec3f363 cleanup: remove static curse_type variables. 2016-08-29 20:12:31 +01:00
Enno Rehling
43090e1492 remove any reference to old two-stage maintenance.
getting rid of a lot of dead code.
2016-08-21 20:02:20 +02:00
Enno Rehling
4f5bd43dcf Merge branch 'master' into develop
Conflicts:
	src/buildno.h
2016-08-07 00:47:50 +02:00
Enno Rehling
44b6a87649 death by NMR was broken, because I can't write loops good. 2016-08-07 00:40:10 +02:00
Steffen Mecke
00ca412634 show item and race if possible 2016-06-11 23:57:01 +02:00
Enno Rehling
c79ecc1a78 fix bug 2211, ignore a match for items we don't have. 2016-06-06 23:24:33 +02:00
Enno Rehling
7fe07439f5 fix write_faction_reference, check for f->alive in other places
TODO:
1. I added some new TODOs
2. What happens to morale when region owners die?
3. Needs tests
2016-02-22 20:47:06 +01:00
Enno Rehling
40530f2066 rename to password_encode, streamline tests 2016-02-12 08:33:08 +01:00
Enno Rehling
0189111876 update key attribute api
prepare to replace at_key. do not return the internals. add basic test.
2016-02-09 06:43:19 +01:00
Enno Rehling
8a3bb35987 eliminate global log_flags, revert the mode arguments for fopen.
turns out that text is default, and windows hates it if I open a binary file without 'b'
standardize on using join_path to create filenames
(use backslash on windows, even though fopen doesn't seem to care).
2016-02-05 23:10:05 +01:00
Enno Rehling
ba39fc9284 I'm really bad at reading. Fixed! 2016-01-31 22:17:55 +01:00
Enno Rehling
ca81dadedb missed a spot! 2016-01-31 22:12:08 +01:00
Enno Rehling
7ebfdb0747 manually smooth out a merge of two commits trying to do the same thing.
prevent negative parents
https://bugs.eressea.de/view.php?id=2183
2016-01-31 22:10:37 +01:00
Enno Rehling
1ec20aed16 fix crash when aging stone circles without an astral plane 2016-01-31 13:47:18 +01:00
Enno Rehling
c08235693d Merge branch 'master' into develop
Conflicts:
	src/buildno.h
	src/kernel/item.c
	src/kernel/region.c
	src/laws.c
2016-01-30 23:09:02 +01:00
Enno Rehling
c557778731 fix https://bugs.eressea.de/view.php?id=2183 2016-01-30 23:04:41 +01:00
Enno Rehling
91f894b290 teleport.c is the astral space implementation, and it is not one of the core concepts, so move it out of the kernel/ directory 2016-01-28 12:25:16 +01:00
Enno Rehling
8d05f4cc25 implement MD5 crypted passwords as default 2016-01-14 15:49:09 +01:00
Enno Rehling
c3da0cd42d as long as we use no encryption, all tests pass. 2016-01-13 16:16:02 +01:00
Enno Rehling
54d25e91dd add a new password module
start adding password hashing logic (WIP)
does not yet pass all tests
2016-01-12 23:52:30 +01:00
Enno Rehling
b6d44410b7 make the password pseudo-private to faction.c 2016-01-12 06:46:51 +01:00
Enno Rehling
b4389c91fe fix compilation (what was I thinking?), remove uses of f.alive where they should not be needed. 2016-01-11 11:54:45 +01:00
Enno Rehling
de512be1ba make destroyfaction remove the faction from the list (slightly scary change) 2016-01-11 09:55:47 +01:00
Enno Rehling
2aafb841a5 Merge branch 'master' into develop
Conflicts:
	res/core/messages.xml
	scripts/eressea/e3/init.lua
	scripts/eressea/xmas.lua
	scripts/eressea/xmasitems.lua
	src/buildno.h
	src/laws.c
2015-12-26 14:46:20 +01:00
Enno Rehling
b66b6f7f4c testing christmas items, removing old xmas scripts 2015-12-22 19:33:44 +01:00
Enno Rehling
3fd4884584 putting all of the pieces together for the snow globe, with final use implementation still TBD
Conflicts:
	scripts/eressea/xmasitems.lua
	src/laws.c
2015-12-22 18:46:42 +01:00
Enno Rehling
5187788f3c pass the parent of an attribute into a_age and attrib_type::age 2015-12-16 22:18:44 +01:00
Steffen Mecke
ad74c0a25d fix rare bug that created negative peasants
when a region had non-standard wage, immigration could cause negative peasants
2015-12-08 17:57:23 +01:00
Enno Rehling
0410581907 Merge branch 'market_tests' of https://github.com/stm2/server into stm2-market_tests
Conflicts:
	src/move.test.c
	src/study.c
2015-11-26 18:42:23 +01:00
Enno Rehling
8aa7fec54c config.c cleanup: move attribute registration to attributes.c 2015-11-24 19:32:52 +01:00
Enno Rehling
5b9333f6d9 Merge branch 'release-3.7' into develop
Conflicts:
	src/buildno.h
	src/monsters.c
2015-11-23 17:12:48 +01:00
Enno Rehling
b6a947ca0c https://bugs.eressea.de/view.php?id=2165
Monster bewachten nicht, wenn sie nicht ausreichend bewaffnet waren, weil der nötige Check nicht in can_start_guarding gemacht wurde, sondern in guard_on_cmd.
2015-11-23 15:35:26 +01:00
Enno Rehling
48c75466b6 kill static caches for floating-point variables 2015-11-22 17:32:35 +01:00
Enno Rehling
2e392b4d7c eliminate even more static variable caches 2015-11-22 16:14:27 +01:00
Enno Rehling
3bd458b5e8 optimization: read configuration once before all battles, not before or during each individual one. 2015-11-22 15:29:43 +01:00
Enno Rehling
a4cb5e2906 replace all get_param_* for global.parameters with config_get_* 2015-11-22 10:44:46 +01:00
Enno Rehling
7e27928d17 eliminate static variables and cache logic from more modules 2015-11-21 12:28:20 +01:00
Steffen Mecke
5326bbd9e4 refactored inside_building/building_is_active/active_building 2015-11-16 02:13:48 +01:00
Enno Rehling
9f94979b0d Merge branch 'bug/#2144' of https://github.com/TurnerSE/server into TurnerSE-bug/#2144 2015-11-07 18:53:19 +01:00
Philipp Dreher
d5f8448d7d changed the handling of an item the unit has no access to
Since the return of display_item() implies that the item, which is
definitely an item but not a potion at this point, is neither in the
inventory of the unit nor an item in the region or the faction's item
pool, the existing message 36 is now triggered in this case and the
previously conditional break is now done indepent of the outcome of
display_item, which shouldn't be critical (it's  an item so it can't be
a spell or a race).
2015-11-04 23:48:30 +01:00
Enno Rehling
9d4489972b CID 22447 Calling risky function
github issue #336
2015-11-04 12:09:45 +01:00
Enno Rehling
24ff4c301d refactor: separate building_is_active from inside_building 2015-11-02 14:18:50 +01:00
Enno Rehling
d6bc1c3119 CID 22506: Dereference null return value (NULL_RETURNS)
always check fopen success
2015-10-30 12:54:07 +01:00
Enno Rehling
ca7d25858e CID 22563: Copy into fixed size buffer (STRING_OVERFLOW)
bsdstring to the rescue, once again
2015-10-30 11:16:09 +01:00
Enno Rehling
96be12218e test rename with missing name (not crashing, error message) 2015-10-13 14:27:42 +02:00
Enno Rehling
177f8f5288 re-enable a test that supposedly breaks on travis (find out why)
fix a potential null-pointer crash in rename_cmd
2015-10-13 13:32:27 +02:00
Enno Rehling
9e49e10d11 Merge branch 'master' into develop
Conflicts:
	src/buildno.h
	src/kernel/unit.test.c
2015-10-10 22:55:29 +02:00
Enno Rehling
99c385412a fix crash in mail_cmd when order is missing a message 2015-10-10 22:50:15 +02:00
Enno Rehling
3055f517dc move guard implementation into a module (WIP) 2015-09-12 22:53:54 +02:00
Enno Rehling
8fa3234159 Merge branch 'master' into develop
Conflicts:
	tests/runtests.bat
2015-09-12 21:00:28 +02:00
Enno Rehling
a027139057 remove global variable verbosity in favor of static in main.c (use log_* functions everywhere) 2015-09-12 20:58:09 +02:00
Enno Rehling
06a04d0e20 fix logging for sp_igjarjuk, temporarily set log-levels for the game to error|warn|info
remove some code that accesses `verbosity` variable (todo: hide it more, fix logging)
2015-09-12 19:48:03 +02:00
Enno Rehling
9bdc811582 produceexp uses a json-configurable constant
make get_param_flt return a double, floats are for wimps.
2015-09-12 16:38:51 +02:00
Enno Rehling
9563aa712f eliminate junk function 2015-09-12 14:16:18 +02:00
Enno Rehling
42f1030251 separate test script for E4:
even though it has mostly the same rules, it does not have xmastrees, and loads a different config
remove dead `inactivefaction` function, we have no use for the file it creates.
2015-09-12 14:10:08 +02:00
Enno Rehling
09efd9c2a9 fix anything that uses the calendar module. opps. 2015-09-12 12:54:49 +02:00
Enno Rehling
f0e255924f add a unit test for add/free prefixes. fix bad free_prefixes call site. 2015-09-12 12:41:04 +02:00
Enno Rehling
f1476c2167 refactoring: split out a module for race prefixes 2015-09-12 12:24:10 +02:00
Enno Rehling
cf08cdf3fb configuration type-fixes: int to bool where appropriate (possibly incomplete)
rename some rules to make it more obvious that they are flags or other integer values.
2015-09-11 10:04:08 +02:00
Enno Rehling
564a041b0d eliminate invalid assertions, remove unnecessary arguments (plant/breed/trees) 2015-08-27 16:53:36 +02:00
Enno Rehling
de808bf146 change effskill signature to take a region, change eff_skill to work on a skill * to avoid multiple lookups. 2015-08-27 16:16:55 +02:00
Enno Rehling
4c32fe19ee eliminate some dead code that was still marked with TODO. 2015-08-21 10:54:09 +02:00
Enno Rehling
dfb0bcaccf Merge branch 'master' into develop
Conflicts:
	src/buildno.h
	src/kernel/save.c
	src/laws.c
2015-08-20 15:49:36 +02:00
Enno Rehling
ff38d8bf4c I don't think it's good to call update_spells before the turn.
one should only have the spells that are in the previous week's report.
a few comments wouldn't hurt.
2015-08-20 12:12:17 +02:00
Enno Rehling
c8cbeea660 STRLCPY macro redefinition and fixes for gcc. work for monkeys. 2015-08-17 22:48:21 +02:00
Enno Rehling
1042c94fd9 quickly fix gcc conversion warnings. lots of DRY. 2015-08-17 20:17:02 +02:00
Enno Rehling
47dccc667b Add a message that contains the password in the first report, so Magellan can pick it up.
Fix a bad type conversion when setting skills.
2015-08-15 20:25:36 +02:00
Enno Rehling
b3a8a95a24 cherry-picking ship tests from range_max code 2015-08-07 11:48:46 +02:00
Enno Rehling
b8a2b9d0b7 Merge pull request #7 from ennorehling/feature/bug-2101-study-teach-testing
bug 2101: increase max printed length of orders
2015-08-06 17:05:32 +02:00
Enno Rehling
8dc4e93e90 fix missing units from CR, add a test, partially convert from FILE* to stream 2015-08-05 14:45:46 +02:00
Enno Rehling
8efc874952 backfill missing tests for ally_cmd 2015-08-05 12:19:17 +02:00
Enno Rehling
928b9966d0 fix broken test (select DESTROY over MOVE), start writing unit tests for update_long_order 2015-08-04 23:04:00 +02:00
Enno Rehling
4d061d8592 repair update_long_order and K_DESTROY handling according to discussion in https://bugs.eressea.de/view.php?id=2080 2015-08-04 22:47:55 +02:00
Enno Rehling
2288b8fb27 Merge remote-tracking branch 'upstream/master' into develop
Conflicts:
	.travis.yml
	s/build
	s/cmake-init
	s/runtests
	src/buildno.h
	src/kernel/config.c
	src/kernel/save.c
	src/kernel/unit.c
	src/laws.c
	src/move.c
2015-08-03 19:43:26 +02:00
Enno Rehling
17f15b69ee fix some of the unicode replacement symbol bullshit in comments 2015-08-02 21:37:12 +02:00
Enno Rehling
27835dc4e1 unit tests for STUDY and TEACH commands. 2015-07-09 13:24:21 +02:00
Enno Rehling
76a9dd6741 Merge remote-tracking branch 'upstream/develop' into develop 2015-07-07 15:34:42 +02:00
Enno Rehling
e25d3c8ed1 Fix a bug reporting DETROY messages to the correct unit.
Add missing not-null assertions before accessing function parameters.
Eliminate all of the PVS-Studio warnings.
2015-07-07 00:49:12 +02:00
Enno Rehling
05ec74f9ec annotate with finds from PVS Studio trial static analysis 2015-07-06 21:31:27 +02:00
Enno Rehling
ef4052b0f6 the outcome of a casual static analysis session. 2015-07-06 19:53:09 +02:00
Enno Rehling
4e67c4ac3f do not remove new players for missing their first turn. 2015-07-05 15:24:46 +02:00
Enno Rehling
6df1e3eeb0 Merge pull request #250 from badgerman/feature/newplayer-fixes
some fixes for new players
2015-07-05 15:21:54 +02:00
Enno Rehling
ae8c448698 do not remove new players for missing their first turn. 2015-07-05 14:07:59 +02:00
Enno Rehling
979f3460d6 Bug 1805: re-enable NMR warnings
https://bugs.eressea.de/view.php?id=1805
move warnings to the top of the list of errors in the NR
2015-07-03 15:31:57 +02:00
Enno Rehling
a2376290d8 Bug 1950: fleeing units can guard the same turn.
checking for UFL_FLEEING in can_start_guarding should make that impossible now.
https://bugs.eressea.de/view.php?id=1950
2015-07-02 17:52:22 +02:00
Enno Rehling
31ca0ce052 fix a parser crash in the USE command. 2015-07-02 13:42:15 +02:00
Enno Rehling
3ba2b3d4d7 indentation fixes (tab->spaces) 2015-06-26 14:31:21 +02:00
Enno Rehling
659aa6c973 after combat, eject enemies only 2015-06-20 14:28:16 +02:00
Enno Rehling
9b7a4e813b functional test for forced leave configuration.
functional test for forced leave after combat.
functional test for MAKE TEMP.
error handling for Lua function building.create().
reduce some errors to warnings.
initialize race.battle_flags correctly (when not created through XML).
re-initialize processor in case config has changed.
handle missing translation of combat status, with error message.
2015-06-19 13:17:01 +02:00
Enno Rehling
e7bffb7533 implement post-combat forced leave from ship/building 2015-06-19 07:53:11 +02:00
Enno Rehling
59400b1e27 Merge branch 'release-3-5' into develop
Conflicts:
	s/runtests
	src/buildno.h
2015-05-24 14:10:42 +02:00
Enno Rehling
6f50027088 use_item can return positive values now 2015-05-24 07:43:11 +02:00
Enno Rehling
e99db198eb bugfix use_item (use_skillpotion did not use pool).
from here on, all use_* functions return the number of items used, and
use_item handles removing them from the unit (or the pool).
2015-05-24 07:17:23 +02:00
Enno Rehling
3a03579a65 rename set_origin/get_origin into faction.c, remove argument from adjust_coordinates. add test for bug 2070. 2015-05-19 08:27:16 +02:00
Enno Rehling
d0f8825240 use the syntax_error function where appropriate.
fix bug w. releasing message too soon.
2015-05-18 11:34:52 +02:00
Enno Rehling
820cdccf32 prettier syntax: C does not require taking an address (&) of a function. 2015-05-18 08:42:35 +02:00