summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-04-21 02:30:39 +0200
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-05-10 21:23:46 +0200
commit848e73703eeb15c650aee38eef46714d3863474f (patch)
treebd30bdda6070106b4e4cb70c973cd60bf3f013d5 /src/map
parent3d9317d3a0bb200b9262be8fb882f33b40bfbd2e (diff)
downloadhercules-848e73703eeb15c650aee38eef46714d3863474f.tar.gz
hercules-848e73703eeb15c650aee38eef46714d3863474f.tar.bz2
hercules-848e73703eeb15c650aee38eef46714d3863474f.tar.xz
hercules-848e73703eeb15c650aee38eef46714d3863474f.zip
Introduce auto-cast vector
Diffstat (limited to 'src/map')
-rw-r--r--src/map/pc.c3
-rw-r--r--src/map/pc.h1
-rw-r--r--src/map/unit.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 5faadf76a..411727c51 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1279,6 +1279,7 @@ static bool pc_authok(struct map_session_data *sd, int login_id2, time_t expirat
sd->bg_queue.client_has_bg_data = 0;
sd->bg_queue.type = 0;
+ VECTOR_INIT(sd->auto_cast); // Initialize auto-cast vector.
VECTOR_INIT(sd->channels);
VECTOR_INIT(sd->script_queues);
VECTOR_INIT(sd->achievement); // Achievements [Smokexyz/Hercules]
@@ -5350,6 +5351,8 @@ static int pc_autocast_clear(struct map_session_data *sd)
sd->autocast.itemskill_instant_cast = false;
sd->autocast.itemskill_cast_on_self = false;
+ VECTOR_TRUNCATE(sd->auto_cast); // Truncate auto-cast vector.
+
return 1;
}
diff --git a/src/map/pc.h b/src/map/pc.h
index e560df549..32b7197a8 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -193,6 +193,7 @@ struct map_session_data {
struct regen_data regen;
struct regen_data_sub sregen, ssregen;
struct autocast_data autocast;
+ VECTOR_DECL(struct autocast_data) auto_cast; // Auto-cast vector.
//NOTE: When deciding to add a flag to state or special_state, take into consideration that state is preserved in
//status_calc_pc, while special_state is recalculated in each call. [Skotlex]
struct {
diff --git a/src/map/unit.c b/src/map/unit.c
index 19f09f83c..8bf0f2ce4 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -2889,6 +2889,8 @@ static int unit_free(struct block_list *bl, enum clr_type clrtype)
aFree(sd->instance);
sd->instance = NULL;
}
+
+ VECTOR_CLEAR(sd->auto_cast); // Clear auto-cast vector.
VECTOR_CLEAR(sd->channels);
VECTOR_CLEAR(sd->script_queues);
VECTOR_CLEAR(sd->achievement); // Achievement [Smokexyz/Hercules]