From a6ed6d63cc9950da3706285ba32915cc262c3d3a Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 26 Jul 2020 11:37:05 +0200 Subject: [PATCH] Add individual C Interface destructors for turn choices. --- CInterface/Battling/TurnChoices.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CInterface/Battling/TurnChoices.cpp b/CInterface/Battling/TurnChoices.cpp index 3c25750..3870c76 100644 --- a/CInterface/Battling/TurnChoices.cpp +++ b/CInterface/Battling/TurnChoices.cpp @@ -9,13 +9,15 @@ export AttackTurnChoice* CreatureLib_AttackTurnChoice_Construct(Creature* user, uint8_t sideIndex, uint8_t targetIndex) { return new AttackTurnChoice(user, attack, CreatureIndex(sideIndex, targetIndex)); } +export void CreatureLib_AttackTurnChoice_Destruct(AttackTurnChoice* p) { delete p; } export FleeTurnChoice* CreatureLib_FleeTurnChoice_Construct(Creature* user) { return new FleeTurnChoice(user); } +export void CreatureLib_FleeTurnChoice_Destruct(AttackTurnChoice* p) { delete p; } export PassTurnChoice* CreatureLib_PassTurnChoice_Construct(Creature* user) { return new PassTurnChoice(user); } +export void CreatureLib_PassTurnChoice_Destruct(AttackTurnChoice* p) { delete p; } export SwitchTurnChoice* CreatureLib_SwitchTurnChoice_Construct(Creature* user, Creature* newCreature) { return new SwitchTurnChoice(user, newCreature); } - -export void CreatureLib_BaseTurnChoice_Destruct(const BaseTurnChoice* p) { delete p; } +export void CreatureLib_SwitchTurnChoice_Destruct(AttackTurnChoice* p) { delete p; } SIMPLE_GET_FUNC(BaseTurnChoice, GetKind, TurnChoiceKind) BORROWED_GET_FUNC(BaseTurnChoice, GetUser, Creature*)