Fixed cashshop removal issue

Fixes #1971
Thanks to @RadianFord
This commit is contained in:
Lemongrass3110
2017-02-17 09:42:37 +01:00
parent 93f74cf567
commit 03ffd99c4d

View File

@@ -316,7 +316,9 @@ bool sale_remove_item( uint16 nameid ){
int i;
// Check if there is an entry for this item id
if( !sale_find_item(nameid, false) ){
sale_item = sale_find_item(nameid, false);
if( sale_item == NULL ){
return false;
}
@@ -326,22 +328,18 @@ bool sale_remove_item( uint16 nameid ){
return false;
}
// Check if the sale is currently running
sale_item = sale_find_item(nameid, true);
if( sale_item != NULL && sale_item->timer_end != INVALID_TIMER ){
// Notify all clients that the sale has ended
clif_sale_end(sale_item, NULL, ALL_CLIENT);
}
if( sale_item->timer_start != INVALID_TIMER ){
delete_timer(sale_item->timer_start, sale_start_timer);
sale_item->timer_start = INVALID_TIMER;
}
// Check if the sale is currently running
if( sale_item->timer_end != INVALID_TIMER ){
delete_timer(sale_item->timer_end, sale_end_timer);
sale_item->timer_end = INVALID_TIMER;
// Notify all clients that the sale has ended
clif_sale_end(sale_item, NULL, ALL_CLIENT);
}
// Find the original pointer in the array