Skip to content

Commit

Permalink
Add missing casting key deletion (#3624)
Browse files Browse the repository at this point in the history
* Added missing key deletion

* add checkSelfCondition
  • Loading branch information
Henrybk committed Sep 8, 2022
1 parent 55ae76f commit 9a92410
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Misc.pm
Expand Up @@ -4913,6 +4913,8 @@ sub checkSelfCondition {
if ($config{$prefix . "_timeout"}) { return 0 unless timeOut($ai_v{$prefix . "_time"}, $config{$prefix . "_timeout"}) }
if ($config{$prefix . "_inLockOnly"} > 0) { return 0 unless ($field->baseName eq $config{lockMap}); }
if ($config{$prefix . "_notWhileSitting"} > 0) { return 0 if ($char->{sitting}); }
if ($config{$prefix . "_notWhileCasting"} > 0) { return 0 if (exists $char->{casting}); }
if ($config{$prefix . "_whileCasting"} > 0) { return 0 unless (exists $char->{casting}); }
if ($config{$prefix . "_notInTown"} > 0) { return 0 if ($field->isCity); }
if ($config{$prefix . "_inTown"} > 0) { return 0 unless ($field->isCity); }
if (defined $config{$prefix . "_monstersCount"}) {
Expand Down
2 changes: 2 additions & 0 deletions src/Network/Receive.pm
Expand Up @@ -11534,6 +11534,8 @@ sub skill_use_failed {
} else {
$errorMessage = T('Unknown error');
}

delete $char->{casting};

warning TF("Skill %s failed: %s (error number %s)\n", Skill->new(idn => $skillID)->getName(), $errorMessage, $type), "skill";
Plugins::callHook('packet_skillfail', {
Expand Down
2 changes: 2 additions & 0 deletions src/Network/Receive/ServerType0.pm
Expand Up @@ -1348,6 +1348,8 @@ sub skill_use_location {
my $source = Actor::get($sourceID);
my $skillName = Skill->new(idn => $skillID)->getName();
my $disp = skillUseLocation_string($source, $skillName, $args);

delete $source->{casting};

# Print skill use message
my $domain = ($sourceID eq $accountID) ? "selfSkill" : "skill";
Expand Down
2 changes: 2 additions & 0 deletions src/Network/Receive/kRO/Sakexe_0.pm
Expand Up @@ -1323,6 +1323,8 @@ sub skill_use_location {
my $source = Actor::get($sourceID);
my $skillName = Skill->new(idn => $skillID)->getName();
my $disp = skillUseLocation_string($source, $skillName, $args);

delete $source->{casting};

# Print skill use message
my $domain = ($sourceID eq $accountID) ? "selfSkill" : "skill";
Expand Down

0 comments on commit 9a92410

Please sign in to comment.