summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-09 22:42:56 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-11-09 22:42:56 +0000
commitf3753f1cd474a84748b88991f74bcaa4f590f4ff (patch)
tree4e0f2fae76761e1b7e267f81f946f68da28b1f2a /src/map/pc.c
parentb397f7c6615f68f044100168eeaf157f6c60227c (diff)
downloadhercules-f3753f1cd474a84748b88991f74bcaa4f590f4ff.tar.gz
hercules-f3753f1cd474a84748b88991f74bcaa4f590f4ff.tar.bz2
hercules-f3753f1cd474a84748b88991f74bcaa4f590f4ff.tar.xz
hercules-f3753f1cd474a84748b88991f74bcaa4f590f4ff.zip
Replaced several 'int' variables with enums that they represent.
Expanded weapon_type enum with dual-wield constants (bugreport:384). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11704 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 0163c21e7..f07165776 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -439,25 +439,26 @@ int pc_calcweapontype(struct map_session_data *sd)
{
nullpo_retr(0, sd);
+ // single-hand
if(sd->weapontype1 != W_FIST && sd->weapontype2 == W_FIST)
sd->status.weapon = sd->weapontype1;
- else if(sd->weapontype1 == W_FIST && sd->weapontype2 != W_FIST)// 蕐 Only
+ else if(sd->weapontype1 == W_FIST && sd->weapontype2 != W_FIST)
sd->status.weapon = sd->weapontype2;
- else if(sd->weapontype1 == W_DAGGER && sd->weapontype2 == W_DAGGER)// ?Z?
- sd->status.weapon = MAX_WEAPON_TYPE+1;
- else if(sd->weapontype1 == W_1HSWORD && sd->weapontype2 == W_1HSWORD)// ???
- sd->status.weapon = MAX_WEAPON_TYPE+2;
- else if(sd->weapontype1 == W_1HAXE && sd->weapontype2 == W_1HAXE)// ??蕀
- sd->status.weapon = MAX_WEAPON_TYPE+3;
- else if( (sd->weapontype1 == W_DAGGER && sd->weapontype2 == W_1HSWORD) ||
- (sd->weapontype1 == W_1HSWORD && sd->weapontype2 == W_DAGGER) ) // Z? - ??
- sd->status.weapon = MAX_WEAPON_TYPE+4;
- else if( (sd->weapontype1 == W_DAGGER && sd->weapontype2 == W_1HAXE) ||
- (sd->weapontype1 == W_1HAXE && sd->weapontype2 == W_DAGGER) ) // Z? -
- sd->status.weapon = MAX_WEAPON_TYPE+5;
- else if( (sd->weapontype1 == W_1HSWORD && sd->weapontype2 == W_1HAXE) ||
- (sd->weapontype1 == W_1HAXE && sd->weapontype2 == W_1HSWORD) ) // ?? -
- sd->status.weapon = MAX_WEAPON_TYPE+6;
+ // dual-wield, matching types
+ else if(sd->weapontype1 == W_DAGGER && sd->weapontype2 == W_DAGGER)
+ sd->status.weapon = W_DOUBLE_DD;
+ else if(sd->weapontype1 == W_1HSWORD && sd->weapontype2 == W_1HSWORD)
+ sd->status.weapon = W_DOUBLE_SS;
+ else if(sd->weapontype1 == W_1HAXE && sd->weapontype2 == W_1HAXE)
+ sd->status.weapon = W_DOUBLE_AA;
+ // dual-wield, mixed types
+ else if(sd->weapontype1 == W_DAGGER && sd->weapontype2 == W_1HSWORD || sd->weapontype1 == W_1HSWORD && sd->weapontype2 == W_DAGGER)
+ sd->status.weapon = W_DOUBLE_DS;
+ else if(sd->weapontype1 == W_DAGGER && sd->weapontype2 == W_1HAXE || sd->weapontype1 == W_1HAXE && sd->weapontype2 == W_DAGGER)
+ sd->status.weapon = W_DOUBLE_DA;
+ else if(sd->weapontype1 == W_1HSWORD && sd->weapontype2 == W_1HAXE || sd->weapontype1 == W_1HAXE && sd->weapontype2 == W_1HSWORD)
+ sd->status.weapon = W_DOUBLE_SA;
+ // unknown, default to left hand type
else
sd->status.weapon = sd->weapontype1;
@@ -885,6 +886,7 @@ int pc_reg_received(struct map_session_data *sd)
{
// set the Guild Master flag
sd->state.gmaster_flag = g;
+ // prevent Guild Skills from being used directly after relog
if( battle_config.guild_skill_relog_delay )
guild_block_skill(sd, 300000);
}