Go to the documentation of this file.
54 static int reference_number = 0;
60 for (exit_ob =
GET_MAP_OB(
map,
x,
y); exit_ob != NULL; exit_ob = exit_ob->above)
61 if (exit_ob->type ==
EXIT && exit_ob->msg != NULL)
71 memset(&rp, 0,
sizeof(
RMParms));
97 snprintf(
buf,
sizeof(
buf),
"%s", cp);
98 while (isdigit(
buf[strlen(
buf)-1]))
102 snprintf(newmap_name,
sizeof(newmap_name),
"/random/%s%04d", cp+1, reference_number++);
107 static void do_run(
void) {
111 int iteration,
x,
y,
map;
116 snprintf(
path,
sizeof(
path),
"/whalingoutpost/underwaterdungeon/level%d",
map);
118 fail_unless(worldmap != NULL,
"Can't load %s",
path);
123 while (random != NULL) {
124 random = get_random_map(random);
135 fail_unless(
check->inv != NULL,
"Horn has empty inventory!");
140 fail_unless(iteration != 0,
"did %d iterations", iteration);
148 static void do_run(
void) {
154 fail_unless(overlay != NULL,
"Couldn't load unique map ../../rsc/bug_1727944_unique");
156 while (
found == 0 && test < 10) {
158 fail_unless(
map != NULL,
"couldn't load map ../../rsc/bug_1727944");
164 fail_unless(
check->inv != NULL,
"Horn has empty inventory!");
165 fail_unless(
check->inv->below == NULL,
"Horn has 2 items in inventory!");
166 if (
check->title && strcmp(
check->title,
"of Plenty") == 0) {
196 if (
op->arch &&
op->name !=
op->arch->clone.name &&
op->name_pl ==
op->arch->clone.name_pl) {
201 if (!
op->name_pl &&
op->name)
216 }
else if ((!strcmp(
op->skill,
"one handed weapons") &&
op->body_info[1] != -1)
217 || (!strcmp(
op->skill,
"two handed weapons") &&
op->body_info[1] != -2)) {
218 LOG(
llevError,
"weapon %s arm usage does not match skill: %d, %s\n",
219 op->name,
op->body_info[1],
op->skill);
239 LOG(
llevDebug,
"Object %s still has last_heal set, not gen_sp_armour\n",
op->name ?
op->name :
"NULL");
240 op->gen_sp_armour =
op->last_heal;
245 if (!
op->item_power &&
ip) {
247 LOG(
llevDebug,
"Object %s had no item power, using %d\n",
op->name ?
op->name :
"NULL",
ip);
257 if (
ip > 2*
op->item_power &&
ip > (
op->item_power+3)) {
258 LOG(
llevDebug,
"Object %s seems to have too low item power? %d > %d\n",
op->name ?
op->name :
"NULL",
ip,
op->item_power);
271 op->randomitems = NULL;
280 op->randomitems = NULL;
282 op->value =
op->arch->clone.value*
op->inv->value;
286 if (
op->stats.hp >
op->stats.maxhp)
287 LOG(
llevDebug,
"Monster %s has hp set higher than maxhp (%d>%d)\n",
op->name,
op->stats.hp,
op->stats.maxhp);
307 temp->reference_count++;
309 temp->tail_x =
op->arch->tail_x;
310 temp->tail_y =
op->arch->tail_y;
312 temp->clone.inv = NULL;
313 temp->clone.env = NULL;
316 temp->clone.map = NULL;
324 temp->clone.speed = 0;
326 temp->clone.speed =
op->speed;
329 temp->more =
op->arch->more;
341 for (test = 0; test < 50; test++)
344 for (test = 0; test < 50; test++) {
346 fail_unless(overlay != NULL,
"Couldn't load unique map ../../rsc/bug_1727944_unique");
347 fail_unless(
GET_MAP_OB(overlay, 2, 3) != NULL,
"No item on spot 2,3?");
350 fail_unless(
check->type ==
ROD,
"Found a non horn?");
351 fail_unless(
check->inv != NULL,
"Horn without a spell!");
352 fail_unless(
check->inv->below == NULL,
"Horn with 2 items in inventory.");
362 fail_unless(horn != NULL,
"couldn't find archetype horn.");
364 fail_unless(horn2 != NULL,
"couldn't find archetype horn2.");
366 for (test = 0; test < 100000; test++) {
370 fail_unless(
check->inv != NULL,
"horn without inventory!");
375 object *the_chest, *
check;
378 fail_unless(tlist != NULL,
"couldn't find treasure list uncommon_items");
380 for (test = 0; test < 10; test++) {
383 fail_unless(
map != NULL,
"failed to get empty map");
387 fail_unless(the_chest != NULL,
"failed to get chest");
393 fail_unless(the_chest != NULL,
"failed to recover chest?");
398 fail_unless(
check->inv != NULL,
"horn without inventory");
399 fail_unless(
check->inv->below == NULL,
"horn with 2 items");
400 fail_unless(
check->randomitems == NULL,
"horn with randomitems set");
406 fail_unless(
found > 100,
"didn't find 100 horn but %d??",
found);
412 Suite *s = suite_create(
"bug");
413 TCase *tc_core = tcase_create(
"Core");
418 suite_add_tcase(s, tc_core);
419 tcase_add_test(tc_core, test_randommaps);
420 tcase_set_timeout(tc_core, 0);
428 SRunner *sr = srunner_create(s);
430 srunner_set_fork_status(sr, CK_NOFORK);
434 srunner_set_xml(sr, LOGDIR
"/bugs/bugtrack/1727944.xml");
435 srunner_set_log(sr, LOGDIR
"/bugs/bugtrack/1727944.out");
436 srunner_run_all(sr, CK_ENV);
437 nf = srunner_ntests_failed(sr);
439 return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
#define GET_MAP_OB(M, X, Y)
void object_set_flag_inv(object *op, int flag)
void LOG(LogLevel logLevel, const char *format,...)
mapstruct * get_empty_map(int sizex, int sizey)
START_TEST(test_randommaps)
mapstruct * ready_map_name(const char *name, int flags)
#define QUERY_FLAG(xyz, p)
archetype * get_archetype_struct(void)
#define FLAG_CONTENT_ON_GEN
int set_random_map_variable(RMParms *rp, const char *buf)
void object_copy(const object *src_ob, object *dest_ob)
#define MAP_PLAYER_UNIQUE
treasurelist * find_treasurelist(const char *name)
mapstruct * generate_random_map(const char *OutFileName, RMParms *RP, char **use_layout, sstring reset_group)
object * object_insert_in_ob(object *op, object *where)
#define SAVE_MODE_OVERLAY
#define FLAG_IS_A_TEMPLATE
void apply_auto_fix(mapstruct *m)
sstring add_string(const char *str)
static END_TEST Suite * bug_suite(void)
void object_update_speed(object *op)
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin it tries to load all available files in the SHARE plugins directory as plugin libraries It first displays the Initializing the plugin has the opportunity to signal itself by a message on the console Then the server displays an informative message containing both the plugin content and its keyword For the Python the standard load process thus GreenGoblin When a plugin has been it can request to be warned whenever a global event and are named freely by the developer If the directory doesn t nothing will happen< event name > can be init
void delete_map(mapstruct *m)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
static void local_check_loaded_object(object *op)
object * create_archetype(const char *name)
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin path(SHARE/plugins). Console messages. ----------------- When Crossfire starts
void free_string(sstring str)
Magical Runes Runes are magical inscriptions on the dungeon which cast a spell or detonate when something steps on them Flying objects don t detonate runes Beware ! Runes are invisible most of the time They are only visible occasionally ! There are several runes which are there are some special runes which may only be called with the invoke and people may apply it to read it Maybe useful for mazes ! This rune will not nor is it ordinarily invisible Partial Visibility of they ll be visible only part of the time They have so the higher your the better hidden the runes you make are Examples of whichever way you re facing invoke magic rune transfer as above
object * create_archetype_by_object_name(const char *name)
archetype * find_archetype(const char *name)
void set_materialname(object *op)
const char *const spell_mapping[SPELL_MAPPINGS]
object * arch_to_object(archetype *at)
region * get_region_by_map(mapstruct *m)
struct treasurelist * randomitems
void object_remove(object *op)
int save_map(mapstruct *m, int flag)
int calc_item_power(const object *op)
static void teardown(void)
void generate_artifact(object *op, int difficulty)
int object_can_merge(object *ob1, object *ob2)