Pārlūkot izejas kodu

Fix vision to be a int32 as it is in the char info structure

Emagi 1 gadu atpakaļ
vecāks
revīzija
c200dc63f7

+ 2 - 2
EQ2/source/WorldServer/Entity.cpp

@@ -286,7 +286,7 @@ void Entity::MapInfoStruct()
 	get_float_funcs["pet_power_pct"] = l::bind(&InfoStruct::get_pet_power_pct, &info_struct);
 	get_int8_funcs["pet_movement"] = l::bind(&InfoStruct::get_pet_movement, &info_struct);
 	get_int8_funcs["pet_behavior"] = l::bind(&InfoStruct::get_pet_behavior, &info_struct);
-	get_int8_funcs["vision"] = l::bind(&InfoStruct::get_vision, &info_struct);
+	get_int32_funcs["vision"] = l::bind(&InfoStruct::get_vision, &info_struct);
 	get_int8_funcs["breathe_underwater"] = l::bind(&InfoStruct::get_breathe_underwater, &info_struct);
 	get_string_funcs["biography"] = l::bind(&InfoStruct::get_biography, &info_struct);
 	get_float_funcs["drunk"] = l::bind(&InfoStruct::get_drunk, &info_struct);
@@ -469,7 +469,7 @@ void Entity::MapInfoStruct()
 	set_float_funcs["pet_power_pct"] = l::bind(&InfoStruct::set_pet_power_pct, &info_struct, l::_1);
 	set_int8_funcs["pet_movement"] = l::bind(&InfoStruct::set_pet_movement, &info_struct, l::_1);
 	set_int8_funcs["pet_behavior"] = l::bind(&InfoStruct::set_pet_behavior, &info_struct, l::_1);
-	set_int8_funcs["vision"] = l::bind(&InfoStruct::set_vision, &info_struct, l::_1);
+	set_int32_funcs["vision"] = l::bind(&InfoStruct::set_vision, &info_struct, l::_1);
 	set_int8_funcs["breathe_underwater"] = l::bind(&InfoStruct::set_breathe_underwater, &info_struct, l::_1);
 	set_string_funcs["biography"] = l::bind(&InfoStruct::set_biography, &info_struct, l::_1);
 	set_float_funcs["drunk"] = l::bind(&InfoStruct::set_drunk, &info_struct, l::_1);

+ 3 - 3
EQ2/source/WorldServer/Entity.h

@@ -606,7 +606,7 @@ struct InfoStruct{
 	float	get_pet_power_pct() { std::lock_guard<std::mutex> lk(classMutex); return pet_power_pct_; }
 	int8	get_pet_movement() { std::lock_guard<std::mutex> lk(classMutex); return pet_movement_; }
 	int8	get_pet_behavior() { std::lock_guard<std::mutex> lk(classMutex); return pet_behavior_; }
-	int8	get_vision() { std::lock_guard<std::mutex> lk(classMutex); return vision_; }
+	int32	get_vision() { std::lock_guard<std::mutex> lk(classMutex); return vision_; }
 	int8	get_breathe_underwater() { std::lock_guard<std::mutex> lk(classMutex); return breathe_underwater_; }
 	std::string get_biography() { std::lock_guard<std::mutex> lk(classMutex); return biography_; }
 	float	get_drunk() { std::lock_guard<std::mutex> lk(classMutex); return drunk_; }
@@ -891,7 +891,7 @@ struct InfoStruct{
 	void	set_weight(int32 value) { std::lock_guard<std::mutex> lk(classMutex); weight_ = value; }
 	void	set_max_weight(int32 value) { std::lock_guard<std::mutex> lk(classMutex); max_weight_ = value; }
 
-	void	set_vision(int8 value) { std::lock_guard<std::mutex> lk(classMutex); vision_ = value; }
+	void	set_vision(int32 value) { std::lock_guard<std::mutex> lk(classMutex); vision_ = value; }
 	void	set_breathe_underwater(int8 value) { std::lock_guard<std::mutex> lk(classMutex); breathe_underwater_ = value; }
 	void	set_drunk(float value) { std::lock_guard<std::mutex> lk(classMutex); drunk_ = value; }
 
@@ -1098,7 +1098,7 @@ private:
 	int8			pet_movement_;
 	int8			pet_behavior_;
 
-	int8          	vision_;
+	int32          	vision_;
 	int8			breathe_underwater_;
 	std::string		biography_;
 	float			drunk_;

+ 1 - 1
EQ2/source/WorldServer/LuaFunctions.cpp

@@ -8829,7 +8829,7 @@ int EQ2Emu_lua_SetVision(lua_State* state) {
 		return 0;
 
 	Spawn* spawn = lua_interface->GetSpawn(state);
-	int8 vision = lua_interface->GetInt8Value(state, 2);
+	int32 vision = lua_interface->GetInt32Value(state, 2);
 	LuaSpell* spell = lua_interface->GetCurrentSpell(state);
 	lua_interface->ResetFunctionStack(state);