Use game state for camp hub checks instead of the direct map name. Prevent added velocity external factors from cancelling a player's spell cast. Release Build 11928.

master
sigonasr2 4 weeks ago
parent 7d0b15f652
commit 48a35faf49
  1. 2
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 4
      Adventures in Lestoria/Item.cpp
  3. 6
      Adventures in Lestoria/Player.cpp
  4. 2
      Adventures in Lestoria/Version.h
  5. BIN
      x64/Release/Adventures in Lestoria.exe

@ -3996,7 +3996,7 @@ bool AiL::UseLoadoutItem(int slot,const std::optional<vf2d>targetingPos){
if(!ISBLANK(GetLoadoutItem(slot).lock())&&GetLoadoutItem(slot).lock()->Amt()>0){
Tutorial::GetTask(TutorialTaskName::USE_RECOVERY_ITEMS).I(A::ITEM_USE_COUNT)++;
Inventory::UseItem(GetLoadoutItem(slot).lock()->ActualName(),1U,targetingPos);
if(game->GetCurrentMapName()!="HUB"){
if(GameState::GetCurrentState()!=States::GAME_HUB){
Inventory::AddLoadoutItemUsed(GetLoadoutItem(slot).lock()->ActualName(),slot);
GetLoadoutItem(slot).lock()->amt--;
}

@ -531,7 +531,9 @@ bool Inventory::UseItem(IT it,uint32_t amt,const std::optional<vf2d>targetingPos
//There are two places to manipulate items in (Both the sorted inventory and the actual inventory)
for(uint32_t i=0;i<amt;i++){
if(ExecuteAction(it,targetingPos)){
return RemoveItem(GetItem(it)[0]);
if(GameState::GetCurrentState()!=States::GAME_HUB){
return RemoveItem(GetItem(it)[0]);
}else return false;
}
}
return false;

@ -682,8 +682,10 @@ void Player::Update(float fElapsedTime){
if(totalVel!=vf2d{}){
float newX=pos.x+totalVel.x*fElapsedTime;
float newY=pos.y+totalVel.y*fElapsedTime;
SetX(newX);
SetY(newY);
MoveFlag::MoveFlag flag{MoveFlag::NONE};
if(vel==vf2d{})flag=MoveFlag::PREVENT_CAST_CANCELLING; //This means added velocity is the only thing affecting movement, we don't stop casting for additional velocity actors.
SetX(newX,flag);
SetY(newY,flag);
if(vel.x>0){
vel.x=std::max(0.f,vel.x-friction*fElapsedTime);
} else {

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 11922
#define VERSION_BUILD 11928
#define stringify(a) stringify_(a)
#define stringify_(a) #a

Loading…
Cancel
Save