Shop: Items must sell for half price, not full price #1110

Closed
Ghabry opened this Issue Mar 4, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@Ghabry
Member

Ghabry commented Mar 4, 2017

buy an item and sell it, you get the same amount.

Expect: You get half

@Ghabry Ghabry added the Window/Scenes label Mar 4, 2017

@Ghabry Ghabry added this to the 0.5.1 milestone Mar 4, 2017

@Ghabry Ghabry changed the title from Shop: Items sell for half price, not full price to Shop: Items must sell for half price, not full price Mar 4, 2017

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Mar 6, 2017

Member

Have a patch for this, will PR later.

diff --git a/src/scene_shop.cpp b/src/scene_shop.cpp
index d6800185..c53e6b57 100644
--- a/src/scene_shop.cpp
+++ b/src/scene_shop.cpp
@@ -263,7 +263,7 @@ void Scene_Shop::UpdateSellSelection() {
 		if (item_id > 0 && Data::items[item_id - 1].price > 0) {
 			RPG::Item& item = Data::items[item_id - 1];
 			Game_System::SePlay(Game_System::GetSystemSE(Game_System::SFX_Decision));
-			number_window->SetData(item_id, Main_Data::game_party->GetItemCount(item_id), item.price);
+			number_window->SetData(item_id, Main_Data::game_party->GetItemCount(item_id), item.price / 2);
 			SetMode(SellHowMany);
 		}
 		else {
diff --git a/src/window_shopnumber.cpp b/src/window_shopnumber.cpp
index 1c028297..f4232346 100644
--- a/src/window_shopnumber.cpp
+++ b/src/window_shopnumber.cpp
@@ -82,5 +82,5 @@ void Window_ShopNumber::Update() {
 }
 
 int Window_ShopNumber::GetTotal() const {
-	return Data::items[item_id - 1].price * number;
+	return price * number;
 }
Member

Ghabry commented Mar 6, 2017

Have a patch for this, will PR later.

diff --git a/src/scene_shop.cpp b/src/scene_shop.cpp
index d6800185..c53e6b57 100644
--- a/src/scene_shop.cpp
+++ b/src/scene_shop.cpp
@@ -263,7 +263,7 @@ void Scene_Shop::UpdateSellSelection() {
 		if (item_id > 0 && Data::items[item_id - 1].price > 0) {
 			RPG::Item& item = Data::items[item_id - 1];
 			Game_System::SePlay(Game_System::GetSystemSE(Game_System::SFX_Decision));
-			number_window->SetData(item_id, Main_Data::game_party->GetItemCount(item_id), item.price);
+			number_window->SetData(item_id, Main_Data::game_party->GetItemCount(item_id), item.price / 2);
 			SetMode(SellHowMany);
 		}
 		else {
diff --git a/src/window_shopnumber.cpp b/src/window_shopnumber.cpp
index 1c028297..f4232346 100644
--- a/src/window_shopnumber.cpp
+++ b/src/window_shopnumber.cpp
@@ -82,5 +82,5 @@ void Window_ShopNumber::Update() {
 }
 
 int Window_ShopNumber::GetTotal() const {
-	return Data::items[item_id - 1].price * number;
+	return price * number;
 }

carstene1ns added a commit that referenced this issue Mar 12, 2017

Ghabry added a commit to libretro/easyrpg-libretro that referenced this issue May 22, 2018

Ghabry pushed a commit to libretro/easyrpg-libretro that referenced this issue May 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment