mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-22 01:12:19 -05:00
Better method and now use the reset flag
This commit is contained in:
parent
65e76dcfee
commit
2aafcc1df2
@ -468,10 +468,12 @@ static bool GiantLinkHandler(std::shared_ptr<Ship::Console> Console, const std::
|
||||
|
||||
try {
|
||||
giantLink = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1;
|
||||
if (giantLink)
|
||||
if (giantLink) {
|
||||
paperLink = 0;
|
||||
minishLink = 0;
|
||||
else
|
||||
} else {
|
||||
resetLinkScale = 1;
|
||||
}
|
||||
|
||||
return CMD_SUCCESS;
|
||||
} catch (std::invalid_argument const& ex) {
|
||||
@ -487,13 +489,14 @@ static bool MinishLinkHandler(std::shared_ptr<Ship::Console> Console, const std:
|
||||
}
|
||||
|
||||
try {
|
||||
resetLinkScale = 1;
|
||||
minishLink = std::stoi(args[1], nullptr, 10) == 0 ? 0 : 1;
|
||||
|
||||
if (minishLink)
|
||||
if (minishLink) {
|
||||
paperLink = 0;
|
||||
giantLink = 0;
|
||||
else
|
||||
} else {
|
||||
resetLinkScale = 1;
|
||||
}
|
||||
|
||||
return CMD_SUCCESS;
|
||||
} catch (std::invalid_argument const& ex) {
|
||||
@ -659,6 +662,12 @@ static bool PaperLinkHandler(std::shared_ptr<Ship::Console> Console, const std::
|
||||
|
||||
try {
|
||||
paperLink = Ship::Math::clamp(std::stoi(args[1], nullptr, 10), 0.0f, 2.0f);
|
||||
if (paperLink) {
|
||||
minishLink = 0;
|
||||
giantLink = 0;
|
||||
} else {
|
||||
resetLinkScale = 1;
|
||||
}
|
||||
return CMD_SUCCESS;
|
||||
} catch (std::invalid_argument const& ex) {
|
||||
SohImGui::console->SendErrorMessage("[SOH] Paper Link value must be a number.");
|
||||
|
@ -11118,16 +11118,10 @@ void Player_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
this->actor.scale.z = 0.001f;
|
||||
}
|
||||
|
||||
if (paperLink == 1) {
|
||||
this->actor.scale.x = 0.001f;
|
||||
if (paperLink != 0) {
|
||||
this->actor.scale.x = paperLink == 1 ? 0.001f : 0.01f;
|
||||
this->actor.scale.y = 0.01f;
|
||||
this->actor.scale.z = 0.01f;
|
||||
}
|
||||
|
||||
if (paperLink == 2) {
|
||||
this->actor.scale.x = 0.01f;
|
||||
this->actor.scale.y = 0.01f;
|
||||
this->actor.scale.z = 0.001f;
|
||||
this->actor.scale.z = paperLink == 2 ? 0.001f : 0.01f;
|
||||
}
|
||||
|
||||
if (resetLinkScale == 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user