summaryrefslogtreecommitdiff
path: root/src/map/homunculus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/homunculus.c')
-rw-r--r--src/map/homunculus.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index ac1c4052b..b642c197f 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -2,7 +2,7 @@
* This file is part of Hercules.
* http://herc.ws - http://github.com/HerculesWS/Hercules
*
- * Copyright (C) 2012-2015 Hercules Dev Team
+ * Copyright (C) 2012-2016 Hercules Dev Team
* Copyright (C) Athena Dev Teams
*
* Hercules is free software: you can redistribute it and/or modify
@@ -227,7 +227,7 @@ int homunculus_calc_skilltree(struct homun_data *hd, int flag_evolve) {
if( hd->homunculus.hskill[ id - HM_SKILLBASE ].id )
continue; //Skill already known.
if(!battle_config.skillfree) {
- for( j = 0; j < MAX_PC_SKILL_REQUIRE; j++ ) {
+ for (j = 0; j < MAX_HOM_SKILL_REQUIRE; j++) {
if( homun->dbs->skill_tree[c][i].need[j].id &&
homun->checkskill(hd,homun->dbs->skill_tree[c][i].need[j].id) < homun->dbs->skill_tree[c][i].need[j].lv ) {
f = 0;
@@ -252,7 +252,7 @@ int homunculus_calc_skilltree(struct homun_data *hd, int flag_evolve) {
if( j < homun->dbs->skill_tree[c][i].intimacylv )
continue;
if(!battle_config.skillfree) {
- for( j = 0; j < MAX_PC_SKILL_REQUIRE; j++ ) {
+ for (j = 0; j < MAX_HOM_SKILL_REQUIRE; j++) {
if( homun->dbs->skill_tree[c][i].need[j].id &&
homun->checkskill(hd,homun->dbs->skill_tree[c][i].need[j].id) < homun->dbs->skill_tree[c][i].need[j].lv ) {
f = 0;
@@ -580,7 +580,7 @@ void homunculus_healed (struct homun_data *hd) {
void homunculus_save(struct homun_data *hd) {
// copy data that must be saved in homunculus struct ( hp / sp )
- TBL_PC * sd;
+ struct map_session_data *sd = NULL;
//Do not check for max_hp/max_sp caps as current could be higher to max due
//to status changes/skills (they will be capped as needed upon stat
//calculation on login)
@@ -786,9 +786,10 @@ bool homunculus_create(struct map_session_data *sd, struct s_homunculus *hom) {
intif->homunculus_requestdelete(hom->hom_id);
return false;
}
- sd->hd = hd = (struct homun_data*)aCalloc(1,sizeof(struct homun_data));
+ CREATE(hd, struct homun_data, 1);
hd->bl.type = BL_HOM;
hd->bl.id = npc->get_new_npc_id();
+ sd->hd = hd;
hd->master = sd;
hd->homunculusDB = &homun->dbs->db[i];
@@ -1234,7 +1235,7 @@ bool homunculus_read_skill_db_sub(char* split[], int columns, int current) {
if (minJobLevelPresent)
homun->dbs->skill_tree[classid][j].joblv = atoi(split[3]);
- for( k = 0; k < MAX_PC_SKILL_REQUIRE; k++ ) {
+ for (k = 0; k < MAX_HOM_SKILL_REQUIRE; k++) {
homun->dbs->skill_tree[classid][j].need[k].id = atoi(split[3+k*2+minJobLevelPresent]);
homun->dbs->skill_tree[classid][j].need[k].lv = atoi(split[3+k*2+minJobLevelPresent+1]);
}