diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-11-14 13:12:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-11-14 13:12:19 +0300 |
commit | fd3ff79b70accad28179fdc23049daec0bec9997 (patch) | |
tree | 51c4327ca1aeee26ee721e97965235e8e1547b10 /src/map | |
parent | 599ed7c8c7073a41c58489d21bb0586c9059abb4 (diff) | |
download | evol-hercules-fd3ff79b70accad28179fdc23049daec0bec9997.tar.gz evol-hercules-fd3ff79b70accad28179fdc23049daec0bec9997.tar.bz2 evol-hercules-fd3ff79b70accad28179fdc23049daec0bec9997.tar.xz evol-hercules-fd3ff79b70accad28179fdc23049daec0bec9997.zip |
Add function to get session extended data by sd.
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/session.c | 10 | ||||
-rw-r--r-- | src/map/session.h | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/map/session.c b/src/map/session.c index a96cbe9..942da0b 100644 --- a/src/map/session.c +++ b/src/map/session.c @@ -10,7 +10,7 @@ #include "../../../common/mmo.h" #include "../../../common/socket.h" #include "../../../common/strlib.h" -#include "../../../login/login.h" +#include "../../../map/pc.h" #include "map/session.h" #include "map/sessionext.h" @@ -26,6 +26,14 @@ struct SessionExt *session_get(int fd) return data; } +struct SessionExt *session_get_bysd(struct map_session_data *sd) +{ + if (!sd) + return NULL; + + return session_get(sd->fd); +} + struct SessionExt *session_create(void) { struct SessionExt *data = NULL; diff --git a/src/map/session.h b/src/map/session.h index 24a82d3..40b05e6 100644 --- a/src/map/session.h +++ b/src/map/session.h @@ -7,6 +7,7 @@ struct SessionExt; struct SessionExt *session_get(int fd); +struct SessionExt *session_get_bysd(struct map_session_data *sd); struct SessionExt *session_create(void); #endif // EVOL_MAP_SESSION |