Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown-gd committed Oct 17, 2024
1 parent f1854ab commit 46dbb71
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 887 deletions.
1 change: 0 additions & 1 deletion lua/gpm/init.yue
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ do
http.EncodeURI = url.encodeURI
http.DecodeURI = url.decodeURI

include( "gpm/libs/yaml.lua" )
include( "gpm/post-util.lua" )
include( "gpm/sql.lua" )

Expand Down
2 changes: 1 addition & 1 deletion lua/gpm/libs/math.yue
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export dot = ( x1, y1, x2, y2 ) -> x1 * x2 + y1 * y2
export isinrange = ( n, a, b ) -> n >= a and n <= b
export trianglesign = ( x1, y1, x2, y2, x3, y3 ) -> ( x1 - x3 ) * ( y2 - y3 ) - ( x2 - x3 ) * ( y1 - y3 )

export inrect = ( x, y, x1, y1, x2, y2 ) -> inrange( x, x1, x2 ) and inrange( y, y1, y2 )
export inrect = ( x, y, x1, y1, x2, y2 ) -> isinrange( x, x1, x2 ) and isinrange( y, y1, y2 )
export incircle = ( x, y, cx, cy, r ) -> pow( x - cx, 2 ) + pow( y - cy, 2 ) <= pow( r, 2 )
export ontangent = ( x, y, x1, y1, x2, y2 ) -> trianglesign( x, y, x1, y1, x2, y2 ) == 0
export intriangle = ( x, y, x1, y1, x2, y2, x3, y3 ) -> trianglesign( x, y, x1, y1, x2, y2 ) * trianglesign( x, y, x2, y2, x3, y3 ) > 0
Expand Down
39 changes: 25 additions & 14 deletions lua/gpm/libs/net.yue
Original file line number Diff line number Diff line change
Expand Up @@ -372,20 +372,6 @@ net.WriteByte = ( number ) ->
WriteUInt( number, 8 )
return nil

net.ReadShort = ->
return ReadInt( 16 )

net.WriteShort = ( number ) ->
WriteInt( number, 16 )
return nil

net.ReadLong = ->
return ReadInt( 32 )

net.WriteLong = ( number ) ->
WriteInt( number, 32 )
return nil

net.ReadUShort = ->
return ReadUInt( 16 )

Expand All @@ -399,3 +385,28 @@ net.ReadULong = ->
net.WriteULong = ( number ) ->
WriteUInt( number, 32 )
return nil

do

import ReadInt, WriteInt from gmod_net

net.ReadSignedByte = ->
return ReadInt( 8 )

net.WriteSignedByte = ( number ) ->
WriteInt( number, 8 )
return nil

net.ReadShort = ->
return ReadInt( 16 )

net.WriteShort = ( number ) ->
WriteInt( number, 16 )
return nil

net.ReadLong = ->
return ReadInt( 32 )

net.WriteLong = ( number ) ->
WriteInt( number, 32 )
return nil
Loading

0 comments on commit 46dbb71

Please sign in to comment.