diff options
| author | Graham Linden <graham@lindenlab.com> | 2013-10-25 10:23:11 -0700 |
|---|---|---|
| committer | Graham Linden <graham@lindenlab.com> | 2013-10-25 10:23:11 -0700 |
| commit | 6480612a91b0e72fa746d294d8cade4f093c9372 (patch) | |
| tree | 8d43a33390938c371fbbc5da804bc2def61a3cef /indra/newview/llworldmap.cpp | |
| parent | 2f0d9b78d28deba58988012a9940cb4f232ec2f9 (diff) | |
| parent | ea1e1b0925b386cf83178539b8eae9e25c573548 (diff) | |
Merge 3.6.9 ShareStorm
Diffstat (limited to 'indra/newview/llworldmap.cpp')
| -rwxr-xr-x | indra/newview/llworldmap.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index fd9cdd95a3..bfae142812 100755 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -518,17 +518,21 @@ bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& case MAP_ITEM_LAND_FOR_SALE: // land for sale case MAP_ITEM_LAND_FOR_SALE_ADULT: // adult land for sale { - F32 cost_per_sqm = 0.0f; - if ((F32)extra > 0) - { - cost_per_sqm = (F32)extra2 / (F32)extra; - } - static LLUIString tooltip_fmt = LLTrans::getString("worldmap_item_tooltip_format"); tooltip_fmt.setArg("[AREA]", llformat("%d", extra)); tooltip_fmt.setArg("[PRICE]", llformat("%d", extra2)); - tooltip_fmt.setArg("[PRICE_PER_SQM]", llformat("%.1f", cost_per_sqm)); + + // 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) |
