summaryrefslogtreecommitdiff
path: root/indra/newview/llworldmap.cpp
diff options
context:
space:
mode:
authorJonathan Yap <none@none>2013-07-28 10:42:51 -0400
committerJonathan Yap <none@none>2013-07-28 10:42:51 -0400
commit22a931efad1380e6c04dce12fe5b16c21d98a908 (patch)
treec0b7ed8f74b695c841a81c3397764e704c6d9a76 /indra/newview/llworldmap.cpp
parent6060e5e46acbeb20a301070a0fd0efea029d33d0 (diff)
STORM-1957 World Map - Land For Sale is missing L$ / sqm
Diffstat (limited to 'indra/newview/llworldmap.cpp')
-rwxr-xr-xindra/newview/llworldmap.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp
index 5fa380e0e3..bfae142812 100755
--- a/indra/newview/llworldmap.cpp
+++ b/indra/newview/llworldmap.cpp
@@ -522,6 +522,17 @@ bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID&
tooltip_fmt.setArg("[AREA]", llformat("%d", extra));
tooltip_fmt.setArg("[PRICE]", llformat("%d", extra2));
+
+ // Check for division by zero
+ if (extra != 0)
+ {
+ tooltip_fmt.setArg("[SQMPRICE]", llformat("%.1f", (F32)extra2 / (F32)extra));
+ }
+ else
+ {
+ tooltip_fmt.setArg("[SQMPRICE]", LLTrans::getString("Unknown"));
+ }
+
new_item.setTooltip(tooltip_fmt.getString());
if (type == MAP_ITEM_LAND_FOR_SALE)