diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-08-21 23:24:50 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-08-21 23:24:50 +0000 |
commit | 67466ae983ea6e2568b3e017c5d1976850308a2a (patch) | |
tree | 290ad7c38bd40662f81a4f649f3058854d27ced6 /src/map/clif.c | |
parent | a26298ee3aa66edb4ef23b291b23ac0419be50f5 (diff) | |
download | hercules-67466ae983ea6e2568b3e017c5d1976850308a2a.tar.gz hercules-67466ae983ea6e2568b3e017c5d1976850308a2a.tar.bz2 hercules-67466ae983ea6e2568b3e017c5d1976850308a2a.tar.xz hercules-67466ae983ea6e2568b3e017c5d1976850308a2a.zip |
* Fixed monsters above Lv99 displaying a Lv99 aura (bugreport:3986).
- The server no longer caps the level sent to the client by default.
- Servers that require the aura to be displayed at a level different from lv99, either have to alter the client or adjust the 'client_limit_unit_lv' setting.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14938 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r-- | src/map/clif.c | 59 |
1 files changed, 50 insertions, 9 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index d45c941ba..5d4d20933 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -756,13 +756,54 @@ void clif_get_weapon_view(struct map_session_data* sd, unsigned short *rhand, un } //To make the assignation of the level based on limits clearer/easier. [Skotlex] -static int clif_setlevel(int lv) +static int clif_setlevel_sub(int lv) { - if( lv < battle_config.max_lv ) - return lv; - if( lv < battle_config.aura_lv ) - return battle_config.max_lv - 1; - return battle_config.max_lv; + if( lv < battle_config.max_lv ) + { + ; + } + else if( lv < battle_config.aura_lv ) + { + lv = battle_config.max_lv - 1; + } + else + { + lv = battle_config.max_lv; + } + + return lv; +} + +static int clif_setlevel(struct block_list* bl) +{ + int lv = status_get_lv(bl); + + switch( bl->type ) + { + case BL_PC: + case BL_HOM: + case BL_MOB: + case BL_MER: + if( battle_config.client_limit_unit_lv&bl->type ) + { + lv = clif_setlevel_sub(lv); + } + break; + case BL_NPC: + case BL_PET: + if( battle_config.client_limit_unit_lv&bl->type ) + { + lv = clif_setlevel_sub(lv); + break; + } + // npcs and pets do not have level + return 0; + default: + ShowWarning("clif_setlevel: Unhandled bl type %d.\n", bl->type); + break; + } + + return lv; } /*========================================== @@ -916,7 +957,7 @@ static int clif_set_unit_idle(struct block_list* bl, unsigned char* buffer, bool offset++; buf = WBUFP(buffer,offset); } - WBUFW(buf,51) = clif_setlevel(status_get_lv(bl)); + WBUFW(buf,51) = clif_setlevel(bl); #if PACKETVER < 20091103 if (type) //End for non-player packet return packet_len(WBUFW(buffer,0)); @@ -1027,7 +1068,7 @@ static int clif_set_unit_walking(struct block_list* bl, struct unit_data* ud, un WBUFPOS2(buf,50,bl->x,bl->y,ud->to_x,ud->to_y,8,8); WBUFB(buf,56) = (sd)? 5 : 0; WBUFB(buf,57) = (sd)? 5 : 0; - WBUFW(buf,58) = clif_setlevel(status_get_lv(bl)); + WBUFW(buf,58) = clif_setlevel(bl); #if PACKETVER >= 20080102 WBUFW(buf,60) = sd?sd->user_font:0; #endif @@ -3102,7 +3143,7 @@ int clif_changeoption2(struct block_list* bl) WBUFW(buf,0) = 0x28a; WBUFL(buf,2) = bl->id; WBUFL(buf,6) = sc->option; - WBUFL(buf,10) = clif_setlevel(status_get_lv(bl)); + WBUFL(buf,10) = clif_setlevel(bl); WBUFL(buf,14) = sc->opt3; if(disguised(bl)) { clif_send(buf,packet_len(0x28a),bl,AREA_WOS); |