summaryrefslogtreecommitdiff
path: root/src/simulation/Simulation.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-03-09 21:50:36 (GMT)
committer jacob1 <jfu614@gmail.com>2013-03-09 21:50:36 (GMT)
commite6f6eedd1364fd3792d6ca7aa3ac2d0c97911f70 (patch)
tree52dfba69783bc6538cb11550b14684801b476952 /src/simulation/Simulation.cpp
parentc66d4c72f5470a46564174ebf7a75c597b275731 (diff)
downloadpowder-e6f6eedd1364fd3792d6ca7aa3ac2d0c97911f70.zip
powder-e6f6eedd1364fd3792d6ca7aa3ac2d0c97911f70.tar.gz
fix empty signs being created when shifting them out of bounds, draw parts of images when it goes partway off the top of the screen.
Diffstat (limited to 'src/simulation/Simulation.cpp')
-rw-r--r--src/simulation/Simulation.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index b6f4f84..3acf413 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -146,10 +146,13 @@ int Simulation::Load(int fullX, int fullY, GameSave * save)
Element_PPIP::ppip_changed = 1;
for(int i = 0; i < save->signs.size() && signs.size() < MAXSIGNS; i++)
{
- sign tempSign = save->signs[i];
- tempSign.x += fullX;
- tempSign.y += fullY;
- signs.push_back(tempSign);
+ if (save->signs[i].text[0])
+ {
+ sign tempSign = save->signs[i];
+ tempSign.x += fullX;
+ tempSign.y += fullY;
+ signs.push_back(tempSign);
+ }
}
for(int saveBlockX = 0; saveBlockX < save->blockWidth; saveBlockX++)
{