Skip to content

Commit

Permalink
Merge pull request #7 from TankNut/entity-encoders
Browse files Browse the repository at this point in the history
Add encoders for Weapon, Vehicle, NextBot and NPC types
  • Loading branch information
Srlion authored Nov 7, 2024
2 parents f3748bd + 3aa58c9 commit 8c637d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sfs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,12 @@ do
write_u16(buf, Entity_EntIndex(ent))
end

-- All of these are reported as their own type but are otherwise identical in handling to entities
encoders.Weapon = encoders.Entity
encoders.Vehicle = encoders.Entity
encoders.NextBot = encoders.Entity
encoders.NPC = encoders.Entity

-- range between 1 and 128 for players, so we can safely use uint8
encoders.Player = function(buf, ply)
write_byte(buf, PLAYER)
Expand Down

0 comments on commit 8c637d5

Please sign in to comment.