|
From: Crossfire C. r. messages.
<cro...@li...> - 2020-11-23 14:18:15
|
Revision: 21562
http://sourceforge.net/p/crossfire/code/21562
Author: ryo_saeba
Date: 2020-11-23 14:18:12 +0000 (Mon, 23 Nov 2020)
Log Message:
-----------
Allow anim_suffix for monsters when attacking, add a default 'attack' animation.
Modified Paths:
--------------
server/trunk/ChangeLog
server/trunk/server/attack.c
Modified: server/trunk/ChangeLog
===================================================================
--- server/trunk/ChangeLog 2020-11-23 14:12:29 UTC (rev 21561)
+++ server/trunk/ChangeLog 2020-11-23 14:18:12 UTC (rev 21562)
@@ -1,5 +1,7 @@
2020-11-23 Nicolas Weeger
* common/anim.c: change function prototype.
+ * server/attack.c: use a default "attack" anim_suffix for attacks. Apply
+ anim_suffix to monsters too.
2020-11-11 Daniel Hawkins and Kevin Zheng
* socket/request.c,
Modified: server/trunk/server/attack.c
===================================================================
--- server/trunk/server/attack.c 2020-11-23 14:12:29 UTC (rev 21561)
+++ server/trunk/server/attack.c 2020-11-23 14:18:12 UTC (rev 21562)
@@ -752,6 +752,7 @@
int simple_attack, roll, dam;
uint32_t type;
tag_t op_tag, hitter_tag;
+ const char *anim_suffix = NULL;
if (get_attack_mode(&op, &hitter, &simple_attack))
return 1;
@@ -765,12 +766,21 @@
if (execute_event(hitter->current_weapon, EVENT_ATTACKS,
hitter, op, NULL, SCRIPT_FIX_ALL) != 0)
return 0;
- if (hitter->current_weapon->anim_suffix)
- apply_anim_suffix(hitter, hitter->current_weapon->anim_suffix);
- } else if (hitter->chosen_skill && hitter->chosen_skill->anim_suffix)
- /* if no weapon, then skill (karate, wraith feed) attack */
- apply_anim_suffix(hitter, hitter->chosen_skill->anim_suffix);
+ }
}
+
+ if (hitter->current_weapon) {
+ anim_suffix = hitter->current_weapon->anim_suffix;
+ } else if (hitter->chosen_skill) {
+ anim_suffix = hitter->chosen_skill->anim_suffix;
+ }
+
+ if (!anim_suffix) {
+ anim_suffix = "attack";
+ }
+ apply_anim_suffix(hitter, anim_suffix);
+
+
op_tag = op->count;
hitter_tag = hitter->count;
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|