diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-29 14:18:20 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-11-29 14:18:20 +0000 |
commit | f648da19a914152a6d772f377dda110fa9248972 (patch) | |
tree | 96269103f190eb9c9ed656ad507104258c864b87 /src/map/chrif.c | |
parent | 042e3e0119641774c456d1c14e70f33d0609a491 (diff) | |
download | hercules-f648da19a914152a6d772f377dda110fa9248972.tar.gz hercules-f648da19a914152a6d772f377dda110fa9248972.tar.bz2 hercules-f648da19a914152a6d772f377dda110fa9248972.tar.xz hercules-f648da19a914152a6d772f377dda110fa9248972.zip |
- Some cleaning on the homunc speed calculating code, so that it correctly uses the default walk speed if the player has no speed yet.
- Some speed up code when loading status changes (use a pointer instead of memcpy'ing all the time)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9359 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r-- | src/map/chrif.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index e08ee8cdf..8c1acdaa4 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1258,7 +1258,7 @@ int chrif_load_scdata(int fd) { //Retrieve and load sc_data for a player. [Skotlex]
#ifdef ENABLE_SC_SAVING
struct map_session_data *sd;
- struct status_change_data data;
+ struct status_change_data *data;
int aid, cid, i, count;
RFIFOHEAD(fd);
@@ -1279,13 +1279,13 @@ int chrif_load_scdata(int fd) count = RFIFOW(fd,12); //sc_count
for (i = 0; i < count; i++)
{
- memcpy(&data, RFIFOP(fd,14 + i*sizeof(struct status_change_data)), sizeof(struct status_change_data));
- if (data.tick < 1)
+ data = (struct status_change_data*)RFIFOP(fd,14 + i*sizeof(struct status_change_data));
+ if (data->tick < 1)
{ //Protection against invalid tick values. [Skotlex]
- ShowWarning("chrif_load_scdata: Received invalid duration (%d ms) for status change %d (character %s)\n", data.tick, data.type, sd->status.name);
+ ShowWarning("chrif_load_scdata: Received invalid duration (%d ms) for status change %d (character %s)\n", data->tick, data->type, sd->status.name);
continue;
}
- status_change_start(&sd->bl, data.type, 10000, data.val1, data.val2, data.val3, data.val4, data.tick, 15);
+ status_change_start(&sd->bl, data->type, 10000, data->val1, data->val2, data->val3, data->val4, data->tick, 15);
}
#endif
return 0;
|