Small correction for SHC_SAVAGE_IMPACT and SHC_DANCING_KNIFE skills (#7496)

* Small correction for SHC_SAVAGE_IMPACT and SHC_DANCING_KNIFE skills
* SHC_SAVAGE_IMPACT should move the player from 1 cell to the target, between the target and the player
* SHC_DANCING_KNIFE shouldn't force the player to stand
* The behaviour should be the same for GC_CROSSIMPACT than SHC_SAVAGE_IMPACT

Thanks to @aleos89 @Lemongrass3110 !
This commit is contained in:
Atemo
2022-12-17 14:08:09 +01:00
committed by GitHub
parent ae686056a0
commit b862aed75c
4 changed files with 37 additions and 8 deletions

View File

@@ -514,3 +514,11 @@ int distance_client(int dx, int dy)
bool direction_diagonal( enum directions direction ){
return direction == DIR_NORTHWEST || direction == DIR_SOUTHWEST || direction == DIR_SOUTHEAST || direction == DIR_NORTHEAST;
}
bool direction_opposite( enum directions direction ){
if( direction == DIR_CENTER || direction == DIR_MAX ){
return direction;
}else{
return static_cast<enum directions>( ( direction + DIR_MAX / 2 ) % DIR_MAX );
}
}