Commit graph

391 commits

Author SHA1 Message Date
Enno Rehling
46d02cf226 Merge branch 'release-774'
Conflicts:
	shared/src/gamecode/market_test.c
	shared/src/kernel/item.c
	shared/src/kernel/item_test.c
	shared/src/tests.c
	shared/src/tests_test.c
2012-05-30 08:12:46 +02:00
Enno Rehling
3e67e7fb4e Lua unit:cast_spell should only cast spells the unit knows.
do not allow payment for spells cast at level <= 0
2012-05-29 20:58:33 -07:00
Enno Rehling
44e5c60c96 test added: when a spell is not found, we do not have to pay for it 2012-05-29 20:44:25 -07:00
Enno Rehling
5e26d246a2 more Lua functions using the wrong stack index. 2012-05-29 20:13:54 -07:00
Enno Rehling
cb0e406733 repair lua spells (bad stack index)
add a whole bunch more spell tests
allow spell tests to disable fumbles
2012-05-29 18:45:50 -07:00
Enno Rehling
347ff0dd77 snprintf is evil and dangerous. 2012-05-29 12:17:25 -07:00
Enno Rehling
330bc9c13b added slprintf and tests for the bsdstring functions 2012-05-29 10:46:48 -07:00
Enno Rehling
131efac393 add a test for f_regionid, catch missing zero-termination 2012-05-28 23:35:27 -07:00
Enno Rehling
7152ffd40f this spell school was misnamed. that's trouble. 2012-05-27 09:52:44 -07:00
Enno Rehling
131840054c giving ownerships over buildings was broken by a recent refactoring 2012-05-27 08:50:34 -07:00
Enno Rehling
36ad727394 avoid duplicate spells in spellbooks (it's a bit hackish) 2012-05-26 15:15:18 -07:00
Enno Rehling
e4244f6282 Familiars and monsters should not get spells from the faction's list. 2012-05-26 14:50:00 -07:00
Enno Rehling
62a91f4558 kill tybied in E3, make common spells the source for random choices 2012-05-26 14:19:35 -07:00
Enno Rehling
2103c1725e Fix accidental parsing of empty strings (Bug 1917) 2012-05-26 12:23:22 -07:00
Enno Rehling
707262c61d fix region owner when a building transfers 2012-05-26 10:43:05 -07:00
Enno Rehling
5547893be7 fix create_roi function in E3 2012-05-26 10:16:39 -07:00
Enno Rehling
8a27917f27 we have one more famililar spell that got renamed 2012-05-26 09:57:07 -07:00
Enno Rehling
da345f0cea only read spellbooks when they are specialized (familiars, monsters, E3 factions) 2012-05-26 09:38:34 -07:00
Enno Rehling
8619bd74a8 slow but working solution for getspell. rebuilding that radix tree for every call is insanity. 2012-05-26 09:05:03 -07:00
Enno Rehling
998549e687 mages have spellbooks now 2012-05-26 08:20:26 -07:00
Enno Rehling
409328a9c2 unit tests for setting combat spells 2012-05-26 07:27:59 -07:00
Enno Rehling
3b3343ae72 spells no longer have a level (or need one) 2012-05-26 00:57:13 -07:00
Enno Rehling
d884446aea we do not require spell-levels in the xmlreader 2012-05-26 00:38:52 -07:00
Enno Rehling
9d1b62d463 updating spell-lists is a thing of the past now
almost everything uses books, except sc_mage
2012-05-26 00:33:55 -07:00
Enno Rehling
c73297ba44 fix an indexing error in pick_random_spell 2012-05-25 23:47:24 -07:00
Enno Rehling
6ffe9cac33 these spells are only in the E2 and E3 source 2012-05-25 23:31:37 -07:00
Enno Rehling
bc95ea80fb espionage messages will now report spellbooks 2012-05-25 23:01:21 -07:00
Enno Rehling
303dd7cc94 creport will now print spellbooks 2012-05-25 22:54:18 -07:00
Enno Rehling
faa72b66b1 untangle the spaghetti a little bit
struct spell is now in spell.h where it belongs
some functions have moved as a result
2012-05-25 22:25:23 -07:00
Enno Rehling
8a4c71f430 unit_add_spell gets a level
added two tests that fail for get_spellfromtoken if spell is not stored with the unit
2012-05-25 21:49:15 -07:00
Enno Rehling
a015d72add unit_add_spell gets a level
added a test that fails for get_spellfromtoken if spell is not stored with the unit
2012-05-25 21:07:26 -07:00
Enno Rehling
d58e853074 allow setting a faction's magic school from Lua 2012-05-25 20:15:57 -07:00
Enno Rehling
24cba1bea7 testing spells in the example server also
WIP: create_roi is broken until mages have spellbooks
2012-05-25 19:55:47 -07:00
Enno Rehling
071f67ea7c use the reportpath from the config file, do not build your own 2012-05-25 18:50:14 -07:00
Enno Rehling
fc259d232b fix spellbook entries in at_reportspell (crash) 2012-05-25 18:30:18 -07:00
Enno Rehling
58cbc3ccbc add some tests for pools, because I found a bug here and we don't want to have that happen again. 2012-05-25 16:15:21 -07:00
Enno Rehling
3b05e2e09e fix compilation on ubuntu 2012-05-25 15:40:03 -07:00
Enno Rehling
fef92e4971 added more test for pay_spell so I don't break it. 2012-05-25 15:38:24 -07:00
Enno Rehling
88db0a8df7 change_resource did not return new value for some types 2012-05-25 15:35:11 -07:00
Enno Rehling
ae9f12c904 added a test for pay_spell so I don't break it. 2012-05-25 12:46:00 -07:00
Enno Rehling
f5b35a9a2b equipment sets that include spells now have levels on them and store in a spellbook.
add some tests for equipment.
2012-05-25 00:45:12 -07:00
Enno Rehling
8ecda7b203 factions have spellbooks and the read/write function for spellbooks is now accessible from other places (we'll need this for units) 2012-05-24 22:26:05 -07:00
Enno Rehling
707349d014 at_reportspell is now a message about a spellbook-entry, not just a spell 2012-05-24 22:10:18 -07:00
Enno Rehling
6cb4322c1d rename: spellbook_clear is more accurate 2012-05-24 21:57:23 -07:00
Enno Rehling
b8d8bac9ae fix trying to add to null-spellbook.
all unit tests pass.
2012-05-24 20:35:13 -07:00
Enno Rehling
6417f55ec6 specify levels with magic attacks (step one to removing spell->level) 2012-05-24 10:24:37 -07:00
Enno Rehling
3514218dba factions have working spellbooks
update of spellbooks for E3 should be functional
old data file is getting read, and levels guessed?
2012-05-24 00:56:54 -07:00
Enno Rehling
9b3234a067 fix the xmlreader to not assert on invalid data 2012-05-23 21:06:19 -07:00
Enno Rehling
92e96689bb spellbooks fully operational (and could be loaded from XML definitions if I had them)
fixed the cleanup between tests to properly free locales
2012-05-23 20:22:12 -07:00
Enno Rehling
f45a494277 new datafile version: spell names are now unique (or will be soon), and writing the magic school with each is irrelevant. 2012-05-23 15:19:40 -07:00
Enno Rehling
db7ed24b3e adding spellbooks.
spellbooks will take the level and magic school out of the spell definitions, and aggregate a list of spells with their minimum levels for learning from. factions will have a list of books they can learn from (different in E2 and E3 already).
2012-05-23 12:42:14 -07:00
Enno Rehling
eea6bdb888 comparison to boolean values is bad form. 2012-05-23 00:09:19 -07:00
Enno Rehling
22ccb5cf95 Merge branch 'master' of gitorious.org:eressea/server 2012-05-22 22:01:57 -07:00
Enno Rehling
56083b1fcf fixing something. findresourcetype, I think? 2012-05-22 22:01:48 -07:00
Enno Rehling
31e4a8432b fix find_spell and create_spell to only create each spell once.
kill register_spell
make some critbit changes (need to transfer them upstream)
2012-05-22 18:44:54 -07:00
Enno Rehling
1672637b17 better command line parsing
fix compilation problem
2012-05-22 14:53:46 -07:00
Enno Rehling
2872dfa772 Added a test that fails for Bug 1909 (findresourcetype is borken) 2012-05-21 21:39:18 -07:00
Enno Rehling
6c51013e14 Nachrichten haben keine Attribute: http://bugs.eressea.de/view.php?id=1912 2012-05-21 21:00:04 -07:00
Enno Rehling
d7c2824ba9 keywords use critbits now 2012-05-21 18:09:30 -07:00
Enno Rehling
ad146602c7 change the order in which TARNE arguments are checked, to handle simple cases first. 2012-05-21 17:56:27 -07:00
Enno Rehling
3394766ab9 double the buffer size for region names 2012-05-21 17:46:59 -07:00
Enno Rehling
1b038a7eaf delete wisps, or any other border that can be read but not written 2012-05-21 17:46:32 -07:00
Enno Rehling
a45eb53191 findskill uses critbits now
killing old PTRIES code
2012-05-21 17:45:54 -07:00
Enno Rehling
ad59fe96b0 buffer size was too small for some special items 2012-05-21 15:47:18 -07:00
Enno Rehling
1e9c10fbe2 finditemtype works as tested.
starting to think about removing default_locale in lieu of a hierarchical system.
2012-05-21 13:18:05 -07:00
Enno Rehling
5ab1b2881a This patches the failure of the test, but it is slow as heck. 2012-05-20 23:06:12 -07:00
Enno Rehling
52e323fef8 added a test that fails because of stupid static state in finditemtype 2012-05-20 23:03:16 -07:00
Enno Rehling
08adc91534 gcc 4.6 is a lot more picky about unused variables, so I shall appease it. 2012-05-20 00:16:12 -07:00
Enno Rehling
7dea6457d1 cleaning up GIVE, because there was too much parameter-searching going on here for the normal case of GIVE X N ITEM 2012-05-19 22:47:52 -07:00
Enno Rehling
8af1cad1dc Merge branch 'master' of gitorious.org:eressea/server 2012-05-19 22:13:02 -07:00
Enno Rehling
5c1f011000 Merge branch 'master' of gitorious.org:eressea/server 2012-05-20 06:55:36 +02:00
Enno Rehling
c6559414c6 fewer findparam calls are better 2012-05-20 06:54:59 +02:00
Enno Rehling
c9902a1d25 move error handling for use_cmd into a single location 2012-05-19 21:01:25 -07:00
Enno Rehling
bcb01742ae remove yet another fintoken warning from the logs 2012-05-19 20:00:54 -07:00
Enno Rehling
cc9a815eea remove another fintoken warning from the logs 2012-05-19 19:54:14 -07:00
Enno Rehling
bcd6991703 testing spells is a lot easier when you can disable fumbles
all tun_tests tests pass
2012-05-19 18:50:28 -07:00
Enno Rehling
3fa4a31d14 trying to figure out why some run_tests tests are not working 2012-05-20 03:21:38 +02:00
Enno Rehling
a342e846bc improved some tests
fixed some resource-related things, especially registration
2012-05-19 17:23:57 -07:00
Enno Rehling
a8a8dfbbb6 registering item types is hard. 2012-05-19 16:55:03 -07:00
Enno Rehling
671e976ad6 Nobody needs to see empty messages in the CR 2012-05-19 16:54:41 -07:00
Enno Rehling
0fc37c9c59 complain properly when the orders are not readable! 2012-05-19 16:54:19 -07:00
Enno Rehling
ee2709e021 fix tests 2012-05-19 22:30:57 +02:00
Enno Rehling
b57db72396 fix broken tests and clear locales (badly) when clearing global stte 2012-05-19 22:21:24 +02:00
Enno Rehling
c8c1d8c27d fix an odd edge-case where there is only a byte left in the destination string, but we're parsing a utf8 character. 2012-05-19 22:13:10 +02:00
Enno Rehling
71f1e35f6d fix an odd edge-case where there is only a byte left in the destination string, but we're parsing a utf8 character. 2012-05-19 13:10:19 -07:00
Enno Rehling
b44737387a fix broken tests and clear locales (badly) when clearing global stte 2012-05-19 20:49:47 +02:00
Enno Rehling
7f7c883583 rt_find and it_find use new improved critbit-tree
critbit update
testing the test suite
2012-05-19 11:26:46 -07:00
Enno Rehling
f47f83ceca a little bit of test coverage for rt_find 2012-05-19 00:18:23 -07:00
Enno Rehling
504a70a9c6 fix a serious issue where repeated orders were getting lost 2012-05-18 23:57:20 -07:00
Enno Rehling
b95f7ec139 more strictly define what it means to be the owner of the show, and when it is transferred.
mostly copied from building_owner.
test coverage is a wonderful thing.
2012-05-18 23:20:38 -07:00
Enno Rehling
0c2531f259 remove UFL_OWNER anywhere but in save.c 2012-05-18 22:34:04 -07:00
Enno Rehling
e501ed5bbd test that we are the owner of the building first. 2012-05-18 21:46:41 -07:00
Enno Rehling
57fbc7809c more strictly define what it means to be the owner of the building, and when it is transferred.
test coverage is a winderful thing.
UFL_OWNER is probably entirely useless now, must fix
2012-05-18 21:26:41 -07:00
Enno Rehling
0616549ea5 new gcc spouts more warnings, fix them. 2012-05-18 19:29:35 -07:00
Enno Rehling
8cd99bf88c fallback for generating building/ship names in tests, when no translations are available 2012-05-18 09:19:46 -07:00
Enno Rehling
ad05ec8c53 fix an assert that was too picky 2012-05-18 02:08:29 +02:00
Enno Rehling
775e8edae1 as much as possible, replace the UFL_OWNER flag with checking the owner the canonical way. 2012-05-17 16:40:50 -07:00
Enno Rehling
95d1203594 repair feedback for not woning anything when trying to destroy. 2012-05-17 15:33:42 -07:00
Enno Rehling
ff33af3c65 ship and building owners encapsulated in accessors
tests added
2012-05-17 15:23:15 -07:00
Enno Rehling
7789e0534e implement ship-ownership transfer as a function
test the reorder_units function
2012-05-17 12:23:25 -07:00
Enno Rehling
43f5770694 Fix ship-owners when control is given 2012-05-17 10:31:58 -07:00
Enno Rehling
9cbdaea27f More tests for ships.
ship->owner is now in use, but there's an assert failing in shipspeed() during report writing.
2012-05-17 01:14:43 -07:00
Enno Rehling
94ca9a1f98 ship->owner not yet ready for primetime
better tests written
2012-05-17 00:25:47 -07:00
Enno Rehling
d12fe2dbed begin making shipowner use ship->owner.
fix a broken test caused by locale_string returning null.
2012-05-17 00:13:30 -07:00
Enno Rehling
ff5dc2534e rename _log_debug to log_debug and get rid of the cumbersome #define 2012-05-16 16:56:07 -07:00
Enno Rehling
ecbe770fce rename _log_error to log_error and get rid of the cumbersome #define 2012-05-16 16:52:01 -07:00
Enno Rehling
14d62afb0d rename _log_warn to log_warning and get rid of the cumbersome #define 2012-05-16 15:52:37 -07:00
Enno Rehling
9065334677 eressea-pbem.de no longer exists
improve default_order generation, save memory.
2012-05-16 13:07:28 -07:00
Enno Rehling
7b6a719a62 findparam improvements!
removed findbuildingtype from findparam
separate isparam() function that I can optimize later
2012-05-16 12:06:44 -07:00
Enno Rehling
02ab10d723 fix const correctness 2012-05-16 18:21:07 +02:00
Enno Rehling
0a6e18f34d Spiking on findparam to use critbit as a findtoken replacement 2012-05-16 09:18:25 -07:00
Enno Rehling
53d35213b6 Merge branch 'master' of gitorious.org:eressea/server
Clean up all warnings that Visual C++ didn't find

Conflicts:
	shared/src/util/umlaut.c
	shared/src/util/umlaut_test.c
2012-05-16 09:48:01 +02:00
Enno Rehling
bfad64695c optimize the number of failed findparam calls a little bit 2012-05-16 09:24:12 +02:00
Enno Rehling
21a49b1660 log_rotate function to fight the increasingly huge logfiles 2012-05-16 09:11:49 +02:00
Enno Rehling
b0959398d8 log library refactoring, first steps 2012-05-16 07:21:59 +02:00
Enno Rehling
64f1ceecf5 logging has a debug/info option now
fixed a bug in the umluaut_test, was not initializing the tnode.
2012-05-16 01:56:25 +02:00
Enno Rehling
116a1ee8ba remove tnode from anywhere, and use a void* instead, in preparation for a new findtoken implementation. this needs to have a good testing.
lots of warning fixes for high warning levels in visual studio also
2012-05-15 15:04:23 -07:00
Enno Rehling
77110158f9 find_function is one of our more frequently called functions, and it can probably do with a little more performance. Let's see if this helps. 2012-05-15 00:19:25 -07:00
Enno Rehling
2d2f566634 A function to transliterate German special characters, for future use. 2012-05-15 00:06:27 -07:00
Enno Rehling
f8cadfebee test suite for the crazy stuff that umlaut.c does. 2012-05-14 20:08:11 -07:00
Enno Rehling
2638f42eca putting the crit-bit tree to use. findingfunctions is faster this way than that hand-rolled list 2012-05-14 17:02:15 -07:00
Enno Rehling
53b9de957c putting the crit-bit tree to use. finding special region resources is faster this way than doing individual strcmp calls. 2012-05-14 16:36:17 -07:00
Enno Rehling
3a8f682bea remove now-obsolete function 2012-05-14 14:16:56 -07:00
Enno Rehling
53bc4eee11 remove viewrange, because it's not used very much (was used for one quest only)
add my crit-bit implementation. to be used soon.
2012-05-14 14:16:02 -07:00
Enno Rehling
e272a00994 add test for that weird function-lookup module before I refactor it. 2012-05-14 13:09:57 -07:00
Enno Rehling
cf6a52bde7 log an error for missing resources 2012-05-12 15:51:28 -07:00
Enno Rehling
08fc39cca7 deal with invalid border types (wisps are getting deleted from Eressea) and disabled spells (again, wisps). 2012-05-12 13:16:07 -07:00
Enno Rehling
88acf39638 spells that have no function in the xml file get one from an array, cleaning up and simplifying that code. 2012-05-09 23:22:54 -07:00
Enno Rehling
12c03644c4 u_hasspell only needs a mage, not a unit 2012-05-09 20:30:26 -07:00
Enno Rehling
882ac9e8e9 pick the correct target region for spells cast by familiars. 2012-05-09 20:23:00 -07:00
Enno Rehling
ee7a35f293 new_castorder is history 2012-05-09 18:42:20 -07:00
Enno Rehling
67ef4c52a3 combat spell functions have the same interface as spells now. 2012-05-09 18:28:33 -07:00
Enno Rehling
06e0d2b3b6 cleaning up castorder, unifying access to target region and caster. 2012-05-09 14:16:41 -07:00
Enno Rehling
02559f6869 refactoring castorder, because it's a bit of a mess of units, fighters, familliars and casters. 2012-05-09 13:46:10 -07:00
Enno Rehling
6dcf6669c3 get_spellfromtoken takes a mage
clarify this code with regards to mages casting through a familiar
2012-05-09 13:18:02 -07:00
Enno Rehling
c10e2552ad get_spellfromtoken needs a mage, not any unit. 2012-05-09 13:06:16 -07:00
Enno Rehling
c41d185cd6 some cleanup 2012-05-09 13:02:08 -07:00
Enno Rehling
c22f49ec36 replace spellid_t with unsigned int
fix finding spells by token
make magic_t an enum
2012-05-09 03:14:54 -07:00
Enno Rehling
ae31948dc5 fix a crash when wolves are cast with too little force 2012-04-16 06:56:44 +02:00
Enno Rehling
80a907d78f repair units that are toads without a time-limit. 2012-04-07 18:11:58 -07:00
Enno Rehling
63799d823d hack to ignore otherfaction attributes if faction stealth is not allowed. 2012-03-04 19:29:32 -08:00
Enno Rehling
52013f0e7c faction stealth is only selectively enabled in E3 2012-03-04 19:21:00 -08:00
Enno Rehling
9640ac19b3 dragon names always contained 2 spaces after the article
http://bugs.eressea.de/view.php?id=1884
2012-03-04 16:42:19 -08:00
Enno Rehling
f7afab976a Merge branch 'master' of gitorious.org:eressea/server 2011-10-28 23:57:30 -07:00
Enno Rehling
e6c094922c update to sqllite 3.7.8 2011-10-28 23:53:28 -07:00
Enno Rehling
d55d62278e fx an off-by-one memcpy error 2011-08-28 06:51:21 +02:00
Enno Rehling
edfa266a32 Fix a crash in turn 733: alps sometimes have weird messages (also, unitmessage is dumb) 2011-08-06 13:56:46 -07:00
Enno Rehling
21b8ab2d31 be nice to your friends, but not your enemies 2011-06-05 12:21:49 -07:00
Enno Rehling
cc870c076c http://bugs.eressea.de/view.php?id=1855
fixing delayed-action potions.
2011-06-04 11:19:44 -07:00
Enno Rehling
bc48f3c29e Merge branch 'master' of gitorious.org:eressea/server 2011-06-04 18:37:27 +02:00