Mercurial > molko
comparison libmlk-rpg/mlk/rpg/battle-bar-default.c @ 442:9c3b3935f0aa
core: rework allocations
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 03 Nov 2022 21:09:25 +0100 |
parents | 25a56ca53ac2 |
children | 773a082f0b91 |
comparison
equal
deleted
inserted
replaced
441:31c1bbc33813 | 442:9c3b3935f0aa |
---|---|
554 assert(bt); | 554 assert(bt); |
555 assert(ch); | 555 assert(ch); |
556 | 556 |
557 (void)bt; | 557 (void)bt; |
558 | 558 |
559 bar->items = mlk_alloc_rearray0(bar->items, bar->itemsz, | 559 bar->items = mlk_alloc_renew0(bar->items, CHARACTER_SPELL_MAX); |
560 CHARACTER_SPELL_MAX, sizeof (*bar->items)); | |
561 bar->itemsz = CHARACTER_SPELL_MAX; | 560 bar->itemsz = CHARACTER_SPELL_MAX; |
562 bar->state = BATTLE_BAR_DEFAULT_STATE_GRID; | 561 bar->state = BATTLE_BAR_DEFAULT_STATE_GRID; |
563 | 562 |
564 for (size_t i = 0; i < CHARACTER_SPELL_MAX; ++i) | 563 for (size_t i = 0; i < CHARACTER_SPELL_MAX; ++i) |
565 if (ch->spells[i]) | 564 if (ch->spells[i]) |