Remove early exit when detecting opposite connection points. Was causing incorrect behaviors between different platforms

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
pull/35/head
Nic0Nic0Nii 10 months ago
parent 1f62a0867a
commit 6d4eba57e4
  1. 6
      Adventures in Lestoria/FunctionPriming.h
  2. 1
      Adventures in Lestoria/InventoryCreator.cpp
  3. 2
      Adventures in Lestoria/Item.cpp
  4. 2
      Adventures in Lestoria/ItemMapData.h
  5. 4
      Adventures in Lestoria/RequiredMaterialsList.h
  6. 1
      Adventures in Lestoria/TMXParser.h
  7. 4
      CMakeLists.txt

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType Portions of this software are copyright <EFBFBD> 2023 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information. Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved. All rights reserved.
*/ */
@ -59,7 +59,7 @@ struct MerchantFunctionPrimingData:public FunctionPrimingData{
:FunctionPrimingData(dependentFunction){} :FunctionPrimingData(dependentFunction){}
virtual inline void Validate(IT item,uint32_t amt){ virtual inline void Validate(IT item,uint32_t amt){
if(!primed)ERR(std::format("WARNING! {} should be called before running this function! Priming Requirement!",dependentFunction)); if(!primed)ERR(std::format("WARNING! {} should be called before running this function! Priming Requirement!",dependentFunction));
if(this->item!=item)ERR(std::format("WARNING! Primed items are not matching! {}!={}",this->item,item)); if(this->item!=item)ERR(std::format("WARNING! Primed items are not matching! {}!={}",std::string(this->item),std::string(item)));
if(this->amt!=amt)ERR(std::format("WARNING! Primed amounts are not matching! {}!={}",this->amt,amt)); if(this->amt!=amt)ERR(std::format("WARNING! Primed amounts are not matching! {}!={}",this->amt,amt));
primed=false; primed=false;
} }
@ -76,7 +76,7 @@ struct ItemEnhancementFunctionPrimingData:public FunctionPrimingData{
:FunctionPrimingData(dependentFunction){} :FunctionPrimingData(dependentFunction){}
virtual inline void Validate(IT item,uint8_t enhancementLevel,uint8_t qty){ virtual inline void Validate(IT item,uint8_t enhancementLevel,uint8_t qty){
if(!primed)ERR(std::format("WARNING! {} should be called before running this function! Priming Requirement!",dependentFunction)); if(!primed)ERR(std::format("WARNING! {} should be called before running this function! Priming Requirement!",dependentFunction));
if(this->item!=item)ERR(std::format("WARNING! Primed items are not matching! {}!={}",this->item,item)); if(this->item!=item)ERR(std::format("WARNING! Primed items are not matching! {}!={}",std::string(this->item),std::string(item)));
if(this->qty!=qty)ERR(std::format("WARNING! Primed items do not have the same quantity! {}!={}",this->qty,qty)); if(this->qty!=qty)ERR(std::format("WARNING! Primed items do not have the same quantity! {}!={}",this->qty,qty));
if(this->enhancementLevel!=enhancementLevel)ERR(std::format("WARNING! Primed enhancement levels are not matching! {}!={}",this->enhancementLevel,enhancementLevel)); if(this->enhancementLevel!=enhancementLevel)ERR(std::format("WARNING! Primed enhancement levels are not matching! {}!={}",this->enhancementLevel,enhancementLevel));
primed=false; primed=false;

@ -102,6 +102,7 @@ std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)>
#pragma region Row Merchant Updates #pragma region Row Merchant Updates
std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> InventoryCreator::RowMerchant_InventorySlotsUpdate= std::function<void(InventoryScrollableWindowComponent&component,ITCategory cat)> InventoryCreator::RowMerchant_InventorySlotsUpdate=
[](InventoryScrollableWindowComponent&component,ITCategory cat){ [](InventoryScrollableWindowComponent&component,ITCategory cat){
const std::vector<std::shared_ptr<Item>>&merchantInv=Merchant::GetCurrentTravelingMerchant().GetShopItems();
component.RemoveAllComponents(); component.RemoveAllComponents();
for(std::shared_ptr<Item> item:merchantInv){ for(std::shared_ptr<Item> item:merchantInv){
component.AddButtonOnSlotUpdate(cat); component.AddButtonOnSlotUpdate(cat);

@ -686,7 +686,7 @@ const std::string Item::Description(CompactText compact)const{
for(const auto&[name,amt]:info.craftingRequirement.GetItems()){ for(const auto&[name,amt]:info.craftingRequirement.GetItems()){
description+=std::format("{}{} x{} ({})\n", description+=std::format("{}{} x{} ({})\n",
Inventory::GetItemCount(name)<amt?"#FF0000":"#FFFFFF", Inventory::GetItemCount(name)<amt?"#FF0000":"#FFFFFF",
name, std::string(const_cast<IT&>(name)),
amt, amt,
Inventory::GetItemCount(name)); Inventory::GetItemCount(name));
} }

@ -45,6 +45,6 @@ struct ItemMapData{
int chance; int chance;
inline ItemMapData(IT item,uint8_t minAmt,uint8_t maxAmt,int chance) inline ItemMapData(IT item,uint8_t minAmt,uint8_t maxAmt,int chance)
:item(item),minAmt(minAmt),maxAmt(maxAmt),chance(chance){ :item(item),minAmt(minAmt),maxAmt(maxAmt),chance(chance){
if(minAmt>maxAmt)ERR(std::format("WARNING! The max amount specified for item {} is less than the minimum amount! {} > {}!",item,minAmt,maxAmt)); if(minAmt>maxAmt)ERR(std::format("WARNING! The max amount specified for item {} is less than the minimum amount! {} > {}!",std::string(item),minAmt,maxAmt));
} }
}; };

@ -30,7 +30,7 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
Portions of this software are copyright © 2023 The FreeType Portions of this software are copyright <EFBFBD> 2023 The FreeType
Project (www.freetype.org). Please see LICENSE_FT.txt for more information. Project (www.freetype.org). Please see LICENSE_FT.txt for more information.
All rights reserved. All rights reserved.
*/ */
@ -78,7 +78,7 @@ protected:
Pixel textCol=WHITE; Pixel textCol=WHITE;
if(Inventory::GetItemCount(name)<amt*qty)textCol=RED; if(Inventory::GetItemCount(name)<amt*qty)textCol=RED;
vf2d drawPos=rect.pos+vf2d{drawWidth*(index%3),12.f*(index/3)}; vf2d drawPos=rect.pos+vf2d{drawWidth*(index%3),12.f*(index/3)};
std::string labelText=std::format("{}",name); std::string labelText=std::format("{}",std::string(const_cast<IT&>(name)));
float labelWidth=game->GetTextSizeProp(labelText).x; float labelWidth=game->GetTextSizeProp(labelText).x;
window.DrawShadowStringDecal(drawPos,std::format("{:>3}",amt*qty),textCol,BLACK); window.DrawShadowStringDecal(drawPos,std::format("{:>3}",amt*qty),textCol,BLACK);
window.DrawShadowStringPropDecal(drawPos+vf2d{26,0},labelText,textCol,BLACK,{std::min(1.f,(drawWidth-26-2)/labelWidth),1.f}); window.DrawShadowStringPropDecal(drawPos+vf2d{26,0},labelText,textCol,BLACK,{std::min(1.f,(drawWidth-26-2)/labelWidth),1.f});

@ -668,7 +668,6 @@ class TMXParser{
if(neighbor.neighbors[targetInd]==-1){ //We insert our neighbor pairing here. if(neighbor.neighbors[targetInd]==-1){ //We insert our neighbor pairing here.
neighbor.neighbors[targetInd]=counter; neighbor.neighbors[targetInd]=counter;
break;
} }
} }
directionInd++; directionInd++;

@ -330,7 +330,7 @@ if (EMSCRIPTEN)
-sLLD_REPORT_UNDEFINED -sLLD_REPORT_UNDEFINED
-sFETCH=1 -sFETCH=1
-sEXPORTED_RUNTIME_METHODS=stringToNewUTF8 -sEXPORTED_RUNTIME_METHODS=stringToNewUTF8
-std=c++20 -std=c++2a
--proxy-to-worker --proxy-to-worker
--preload-file ${SOURCE_DATA_DIR}@assets) --preload-file ${SOURCE_DATA_DIR}@assets)
else() else()
@ -344,7 +344,7 @@ if (EMSCRIPTEN)
-sUSE_FREETYPE=1 -sUSE_FREETYPE=1
-sFETCH=1 -sFETCH=1
-sEXPORTED_RUNTIME_METHODS=stringToNewUTF8 -sEXPORTED_RUNTIME_METHODS=stringToNewUTF8
-std=c++20 -std=c++2a
--proxy-to-worker --proxy-to-worker
-sLLD_REPORT_UNDEFINED) -sLLD_REPORT_UNDEFINED)
endif() endif()

Loading…
Cancel
Save