diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-31 12:12:42 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-12-31 12:12:42 +0000 |
commit | 5178ca9df008ecff5e78fb52baddedac9c318702 (patch) | |
tree | 9ebbaf51e6050147a949d24a0107f939488a4aae /src/map/unit.c | |
parent | b81e57a9a349e06fba2ad56757ea3d08b01db586 (diff) | |
download | hercules-5178ca9df008ecff5e78fb52baddedac9c318702.tar.gz hercules-5178ca9df008ecff5e78fb52baddedac9c318702.tar.bz2 hercules-5178ca9df008ecff5e78fb52baddedac9c318702.tar.xz hercules-5178ca9df008ecff5e78fb52baddedac9c318702.zip |
* Refer to http://www.eathena.ws/board/index.php?showtopic=130285
- Renamed pc_checkweighticon to pc_updateweightstatus and cleaned it.
- Updated pc_is50overweight to use battle_config.natural_heal_weight_rate.
- Added 90% weight check when attacking.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9600 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index 213168682..21175cc30 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1147,7 +1147,7 @@ int unit_unattackable(struct block_list *bl) { *------------------------------------------ */ -int unit_attack(struct block_list *src,int target_id,int type) +int unit_attack(struct block_list *src,int target_id,int continuous) { struct block_list *target; struct unit_data *ud; @@ -1160,9 +1160,18 @@ int unit_attack(struct block_list *src,int target_id,int type) return 1; } - if(src->type == BL_PC && target->type==BL_NPC) { // monster npcs [Valaris] - npc_click((TBL_PC*)src,(TBL_NPC*)target); // submitted by leinsirk10 [Celest] - return 0; + if( src->type == BL_PC ){ + TBL_PC* sd = (TBL_PC*)src; + if( target->type == BL_NPC ) + {// monster npcs [Valaris] + npc_click(sd,(TBL_NPC*)target); // submitted by leinsirk10 [Celest] + return 0; + } else if( pc_is90overweight(sd) ) + {// overwheight - stop attacking and walking + unit_stop_attack(src); + unit_stop_walking(src,1); + return 0; + } } if(battle_check_target(src,target,BCT_ENEMY)<=0 || @@ -1173,10 +1182,10 @@ int unit_attack(struct block_list *src,int target_id,int type) } ud->target = target_id; - ud->state.attack_continue = type; - if (type) //If you re to attack continously, set to auto-case character + ud->state.attack_continue = continuous; + if (continuous) //If you're to attack continously, set to auto-case character ud->chaserange = status_get_range(src); - + //Just change target/type. [Skotlex] if(ud->attacktimer != -1) return 0; |