Kaynağa Gözat

Fix multiply by scalar

Daniele Bartolini 10 yıl önce
ebeveyn
işleme
b89e169633
1 değiştirilmiş dosya ile 2 ekleme ve 3 silme
  1. 2 3
      src/lua/lua_math.cpp

+ 2 - 3
src/lua/lua_math.cpp

@@ -836,9 +836,8 @@ static int lightuserdata_sub(lua_State* L)
 static int lightuserdata_mul(lua_State* L)
 {
 	LuaStack stack(L);
-	const Vector3& a = stack.get_vector3(1);
-	const float b = stack.get_float(2);
-	stack.push_vector3(a * b);
+	const int fidx = stack.is_number(1) ? 1 : 2;
+	stack.push_vector3(stack.get_float(fidx) * stack.get_vector3(3-fidx));
 	return 1;
 }