Permalink
Browse files

Fixed yet another error with constraint library

Sometimes "material" is a boolean apparently.
  • Loading branch information...
1 parent 411e987 commit 517f166f057b9f094555168f4246c4316597ceab @robotboy655 robotboy655 committed Feb 15, 2015
Showing with 4 additions and 2 deletions.
  1. +4 −2 garrysmod/lua/includes/modules/constraint.lua
@@ -333,8 +333,10 @@ function CreateKeyframeRope( Pos, width, material, Constraint, Ent1, LPos1, Bone
rope:SetPos( Pos )
rope:SetKeyValue( "Width", width )
- local mat = Material(material)
- if ( material && !string.find( mat:GetShader():lower(), "spritecard" ) ) then rope:SetKeyValue( "RopeMaterial", material ) end
+ if ( isstring( material ) ) then
+ local mat = Material( material )
+ if ( material && !string.find( mat:GetShader():lower(), "spritecard" ) ) then rope:SetKeyValue( "RopeMaterial", material ) end
+ end
-- Attachment point 1
rope:SetEntity( "StartEntity", Ent1 )

0 comments on commit 517f166

Please sign in to comment.