Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Commit the updated percentage type.

  • Loading branch information...
commit b1fe3cf3cfee99985ae780278d754a79c804078b 1 parent 43b260f
Andrew Copland fluffyfreak authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Factions.cpp
4 src/Factions.cpp
View
@@ -139,7 +139,7 @@ static int l_fac_illegal_goods_probability(lua_State *L)
Faction *fac = l_fac_check(L, 1);
const char *typeName = luaL_checkstring(L, 2);
const Equip::Type e = static_cast<Equip::Type>(LuaConstants::GetConstant(L, "EquipType", typeName));
- const int probability = luaL_checkinteger(L, 3);
+ const uint32_t probability = luaL_checkunsigned(L, 3);
if (e < Equip::FIRST_COMMODITY || e > Equip::LAST_COMMODITY) {
pi_lua_warn(L,
@@ -148,7 +148,7 @@ static int l_fac_illegal_goods_probability(lua_State *L)
return 0;
}
- if (probability < 0 || probability > 100) {
+ if (probability > 100) {
pi_lua_warn(L,
"argument (probability 0-100) out of range: Faction{%s}:IllegalGoodsProbability('%s', %d)",
fac->name.c_str(), typeName, probability);
Please sign in to comment.
Something went wrong with that request. Please try again.