X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=src%2Fserver%2Fthings.c;h=ffa30b01324b4405c143fa6d3c5617d06cb052fe;hb=6db8d212ad66a7a934a47f319f88d1c811791798;hp=bbe9dbffe39388399b741965c7ead8bb2aa61baa;hpb=491e8bc8e7a9b1d312256817c0b8be7e05b127be;p=plomrogue diff --git a/src/server/things.c b/src/server/things.c index bbe9dbf..ffa30b0 100644 --- a/src/server/things.c +++ b/src/server/things.c @@ -28,9 +28,6 @@ struct NextAndId -/* Free ThingsInMemory chain starting at "tm". */ -static void free_things_in_memory(struct ThingInMemory * tm); - /* To linked list of NextAndId structs (or rather structs whose start region is * compatible to it) starting at "start", add newly allocated element of * "n_size" and an ID that is either "id" or, if "id" is <= UINT8_MAX and >= @@ -43,18 +40,6 @@ static struct NextAndId * add_to_struct_list(size_t n_size, uint8_t start_id, -static void free_things_in_memory(struct ThingInMemory * tm) -{ - if (!tm) - { - return; - } - free_things_in_memory(tm->next); - free(tm); -} - - - static struct NextAndId * add_to_struct_list(size_t n_size, uint8_t start_id, int16_t id, uint8_t struct_id, struct NextAndId ** start) @@ -195,6 +180,18 @@ extern void free_things(struct Thing * t) +extern void free_things_in_memory(struct ThingInMemory * tm) +{ + if (!tm) + { + return; + } + free_things_in_memory(tm->next); + free(tm); +} + + + extern struct ThingAction * get_thing_action(uint8_t id) { struct ThingAction * ta = world.thing_actions;