@@ -49,8 +49,9 @@ namespace Stockfish::Eval::NNUE::Features {
4949 inline IndexType HalfKAv2Variants::make_potion_zone_index (Color perspective, Color potionColor,
5050 Variant::PotionType potion, Square s,
5151 Square ksq, const Position& pos) {
52+ const int relativeColor = static_cast <int >(potionColor != perspective);
5253 const int potionIndex = static_cast <int >(potion)
53- + Variant::POTION_TYPE_NB * static_cast < int >(potionColor) ;
54+ + Variant::POTION_TYPE_NB * relativeColor ;
5455 return IndexType (orient (perspective, s, pos)
5556 + pos.nnue_potion_zone_index_base ()
5657 + potionIndex * (pos.max_file () + 1 ) * (pos.max_rank () + 1 )
@@ -60,9 +61,9 @@ namespace Stockfish::Eval::NNUE::Features {
6061 inline IndexType HalfKAv2Variants::make_potion_cooldown_index (Color perspective, Color potionColor,
6162 Variant::PotionType potion, int bit,
6263 Square ksq, const Position& pos) {
63- ( void ) perspective;
64+ const int relativeColor = static_cast < int >(potionColor != perspective) ;
6465 const int potionIndex = static_cast <int >(potion)
65- + Variant::POTION_TYPE_NB * static_cast < int >(potionColor) ;
66+ + Variant::POTION_TYPE_NB * relativeColor ;
6667 return IndexType (bit
6768 + pos.nnue_potion_cooldown_index_base ()
6869 + potionIndex * POTION_COOLDOWN_BITS
0 commit comments