Skip to content

Commit

Permalink
Fixes to onCreateObject event handlers (#4)
Browse files Browse the repository at this point in the history
Fixes to onCreateObject event handlers:
changed data.unk1 and data.unk2 to data.noCameraCol and data.syncRotation
changed attachToPlayerId to attachToObjectId
  • Loading branch information
AmyrAhmady authored and THE-FYP committed Mar 13, 2018
1 parent 304074f commit e9b8173
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions samp/events/handlers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function handler.on_vehicle_sync_writer(bs, data)
end


--- onVehicleSteamIn
--- onVehicleStreamIn
function handler.on_vehicle_stream_in_reader(bs)
local read = BitStreamIO.bs_read
local data = {modSlots = {}}
Expand Down Expand Up @@ -515,13 +515,13 @@ function handler.on_create_object_reader(bs)
data.position = read.vector3d(bs)
data.rotation = read.vector3d(bs)
data.drawDistance = read.float(bs)
data.unk1 = read.int8(bs)
data.noCameraCol = read.bool8(bs)
data.attachToVehicleId = read.int16(bs)
data.attachToPlayerId = read.int16(bs)
data.attachToObjectId = read.int16(bs)
if data.attachToVehicleId ~= 65535 or data.attachToPlayerId ~= 65535 then
data.attachOffsets = read.vector3d(bs)
data.attachRotation = read.vector3d(bs)
data.unk2 = read.int8(bs)
data.syncRotation = read.bool8(bs)
end
data.texturesCount = read.int8(bs)

Expand All @@ -547,13 +547,13 @@ function handler.on_create_object_writer(bs, data)
write.vector3d(bs, data.position)
write.vector3d(bs, data.rotation)
write.float(bs, data.drawDistance)
write.int8(bs, data.unk1)
write.bool8(bs, data.noCameraCol)
write.int16(bs, data.attachToVehicleId)
write.int16(bs, data.attachToPlayerId)
write.int16(bs, data.attachToObjectId)
if data.attachToVehicleId ~= 65535 or data.attachToPlayerId ~= 65535 then
write.vector3d(bs, data.attachOffsets)
write.vector3d(bs, data.attachRotation)
write.int8(bs, data.unk2)
write.bool8(bs, data.syncRotation)
end
write.int8(bs, data.texturesCount)

Expand Down

0 comments on commit e9b8173

Please sign in to comment.