summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/status.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/map/status.c b/src/map/status.c
index 0a29a5d2f..d656a8e3a 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -6497,7 +6497,22 @@ int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int ti
}
/* [Ind/Hercules] fast-checkin sc-display array */
void status_display_add(struct map_session_data *sd, enum sc_type type, int dval1, int dval2, int dval3) {
- struct sc_display_entry *entry = ers_alloc(pc_sc_display_ers, struct sc_display_entry);
+ struct sc_display_entry *entry;
+ int i;
+
+ for( i = 0; i < sd->sc_display_count; i++ ) {
+ if( sd->sc_display[i]->type == type )
+ break;
+ }
+
+ if( i != sd->sc_display_count ) {
+ sd->sc_display[i]->val1 = dval1;
+ sd->sc_display[i]->val2 = dval2;
+ sd->sc_display[i]->val3 = dval3;
+ return;
+ }
+
+ entry = ers_alloc(pc_sc_display_ers, struct sc_display_entry);
entry->type = type;
entry->val1 = dval1;