summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/emap/pc.c5
-rw-r--r--src/emap/send.c11
-rw-r--r--src/emap/status.c6
3 files changed, 14 insertions, 8 deletions
diff --git a/src/emap/pc.c b/src/emap/pc.c
index f5c22c6..d116a41 100644
--- a/src/emap/pc.c
+++ b/src/emap/pc.c
@@ -423,6 +423,7 @@ int epc_delitem_post(int retVal,
bool epc_can_insert_card_into_post(bool retVal, struct map_session_data* sd,
int *idx_card, int *idx_equip)
{
+ int f;
if (retVal)
{
struct ItemdExt *data = itemd_get(sd->inventory_data[*idx_equip]);
@@ -432,7 +433,7 @@ bool epc_can_insert_card_into_post(bool retVal, struct map_session_data* sd,
const int newCardId = sd->status.inventory[*idx_card].nameid;
int cardAmountLimit = 0;
- for (int f = 0; f < 100 && data->allowedCards[f].id; f ++)
+ for (f = 0; f < 100 && data->allowedCards[f].id; f ++)
{
if (data->allowedCards[f].id == newCardId)
{
@@ -445,7 +446,7 @@ bool epc_can_insert_card_into_post(bool retVal, struct map_session_data* sd,
int cardsAmount = 0;
const int slots = sd->inventory_data[*idx_equip]->slot;
- for (int f = 0; f < slots; f ++)
+ for (f = 0; f < slots; f ++)
{
const int cardId = sd->status.inventory[*idx_equip].card[f];
if (cardId == newCardId)
diff --git a/src/emap/send.c b/src/emap/send.c
index 2ef2d49..894d4e0 100644
--- a/src/emap/send.c
+++ b/src/emap/send.c
@@ -84,6 +84,7 @@ void send_changelook(struct map_session_data* sd, struct map_session_data* sd2,
struct item_data *data, int n)
{
struct SessionExt *tdata = session_get_bysd(sd2);
+ int i;
//ShowWarning("equip: for type %d = %d\n", type, val);
if (!tdata || tdata->clientVersion < 9)
{
@@ -105,7 +106,7 @@ void send_changelook(struct map_session_data* sd, struct map_session_data* sd2,
WFIFOW (fd, 9) = val2;
if (data)
{
- for (int i = 0; i < data->slot; i++ )
+ for (i = 0; i < data->slot; i++ )
{
struct item_data *data;
if (!sd->status.inventory[n].card[i])
@@ -116,7 +117,7 @@ void send_changelook(struct map_session_data* sd, struct map_session_data* sd2,
WFIFOW (fd, 11 + i * 2) = data->nameid;
}
}
- for (int i = data->slot; i < MAX_SLOTS; i ++)
+ for (i = data->slot; i < MAX_SLOTS; i ++)
WFIFOW (fd, 11 + i * 2) = 0;
}
else
@@ -352,6 +353,8 @@ void send_changelook2(struct map_session_data* sd, struct block_list *bl, int id
{
//ShowWarning("equip: for type %d = %d\n", type, val);
unsigned char buf[32];
+ int i;
+
WBUFW(buf, 0) = 0x1d7;
WBUFL(buf, 2) = id;
WBUFB(buf, 6) = type;
@@ -362,7 +365,7 @@ void send_changelook2(struct map_session_data* sd, struct block_list *bl, int id
if (data)
{
//ShowWarning("equip: for type %d\n", type);
- for (int i = 0; i < data->slot; i++ )
+ for (i = 0; i < data->slot; i++ )
{
struct item_data *data;
if (!sd->status.inventory[n].card[i])
@@ -373,7 +376,7 @@ void send_changelook2(struct map_session_data* sd, struct block_list *bl, int id
WBUFW(buf, 11 + i * 2) = data->nameid;
}
}
- for (int i = data->slot; i < MAX_SLOTS; i ++)
+ for (i = data->slot; i < MAX_SLOTS; i ++)
WBUFW(buf, 11 + i * 2) = 0;
}
else
diff --git a/src/emap/status.c b/src/emap/status.c
index 935a2a4..dd9c46a 100644
--- a/src/emap/status.c
+++ b/src/emap/status.c
@@ -76,9 +76,12 @@ int estatus_calc_pc_(int retVal,
int estatus_calc_pc_additional(struct map_session_data* sd,
enum e_status_calc_opt *opt __attribute__ ((unused)))
{
+ int f;
+ int k;
+
hookStop();
- for (int f = 0; f < MAX_INVENTORY; f ++)
+ for (f = 0; f < MAX_INVENTORY; f ++)
{
struct item_data *const item = sd->inventory_data[f];
if (!item)
@@ -88,7 +91,6 @@ int estatus_calc_pc_additional(struct map_session_data* sd,
if (!data || !data->charmItem)
continue;
- int k;
for (k = 0; k < map->list[sd->bl.m].zone->disabled_items_count; k ++)
{
if (map->list[sd->bl.m].zone->disabled_items[k] == item->nameid)