Spellforce-Spell-framework
Loading...
Searching...
No Matches
sf_refresh_hook.c
Go to the documentation of this file.
1
10#include "../sf_wrappers.h"
12#include <stdint.h>
13#include <stdlib.h>
14#include <stdio.h>
15#include <string.h>
16
17#include "sf_refresh_hook.h"
18
19int __thiscall sf_refresh_hook(SF_CGdSpell *_this, uint16_t spell_index)
20{
21 // We need a map of refresh handlers?
22 uint16_t spell_line = _this->active_spell_list[spell_index].spell_line;
23 refresh_handler_ptr spellrefresh_handler = get_spell_refresh(spell_line);
24 /* char message[256];
25 sprintf(message, "Spell Refresh Hook: [%d]", spell_index);
26 log_info(message);
27 */
28 if (spellrefresh_handler != NULL)
29 {
30 return spellrefresh_handler(_this, spell_index);
31 }
32 // Default return is 1, it can be 0
33 return 1;
34}
35
int __thiscall sf_refresh_hook(SF_CGdSpell *_this, uint16_t spell_index)
int(__thiscall * refresh_handler_ptr)(SF_CGdSpell *, uint16_t)
refresh_handler_ptr get_spell_refresh(uint16_t spell_line_id)
SF_GdSpell active_spell_list[800]