commit 7a1e7c35
Fix "hurt" animation
Changed files
| M | data/sprites/humans.sprite before |
| M | extra/scripts/python/create_human_sprite.py before |
| M | src/saland/Game.cpp before |
diff --git a/data/sprites/humans.sprite b/data/sprites/humans.sprite
index 2e7cc55..330a9e7 100644
--- a/data/sprites/humans.sprite
+++ b/data/sprites/humans.sprite
@@ -194,7 +194,7 @@
}
,
"male_hurt_S" : {
-"texture" : "male_slash",
+"texture" : "male_hurt",
"topx" : 0,
"topy" : 0,
"height" : 64,
@@ -398,7 +398,7 @@
}
,
"female_hurt_S" : {
-"texture" : "female_slash",
+"texture" : "female_hurt",
"topx" : 0,
"topy" : 0,
"height" : 64,
diff --git a/extra/scripts/python/create_human_sprite.py b/extra/scripts/python/create_human_sprite.py
index 9ab9055..8d84c17 100644
--- a/extra/scripts/python/create_human_sprite.py
+++ b/extra/scripts/python/create_human_sprite.py
@@ -12,7 +12,7 @@ def print_male(race="male", file=sys.stdout):
print(",", file=file)
common.directional_sprite.print_sprite(race=race, animation="slash", name=None, texture=race+"_slash", topY=0, number_of_frames=6, file=file)
print(",", file=file)
- common.directional_sprite.print_sprite_direction(race=race, animation="hurt", name=None, texture=race+"_slash", topY=0, number_of_frames=6, file=file)
+ common.directional_sprite.print_sprite_direction(race=race, animation="hurt", name=None, texture=race+"_hurt", topY=0, number_of_frames=6, file=file)
def print_weapon(texture, weapon_name, file=sys.stdout):
diff --git a/src/saland/Game.cpp b/src/saland/Game.cpp
index 5739fa1..dab62ee 100644
--- a/src/saland/Game.cpp
+++ b/src/saland/Game.cpp
@@ -708,7 +708,7 @@ void Game::Update() {
if (selectedSpell.name == "weapon_slash_long_knife") {
data->human->weapon = "long_knife";
}
- if (SDL_GetMouseState(nullptr,nullptr) & 1 && !data->consoleActive) {
+ if (SDL_GetMouseState(nullptr,nullptr) & 1 && !data->consoleActive && data->human->diedAt == 0) {
if (data->slot_spell.at(data->slot_selected).name == "spell_fireball") {
if (data->human->castTimeRemaining == 0) {
data->human->castTimeRemaining = data->human->castTime;