Commit 97d6c6ec3dc173114df4d9330e4f4ae94a5bc8f1

Authored by dg
1 parent 9aac7965

Bad shaders should not crash the engine, just not work


git-svn-id: http://svn.net-core.org/repos/t-engine4@913 51575b47-30f0-44d4-a5cc-537603b46e54
@@ -175,6 +175,7 @@ newTalent{ @@ -175,6 +175,7 @@ newTalent{
175 return ([[Touch your foe and turn it into stone for %d turns. 175 return ([[Touch your foe and turn it into stone for %d turns.
176 Stoned creatures are unable to act or regen life and are very brittle. 176 Stoned creatures are unable to act or regen life and are very brittle.
177 If a stoned creature if hit by an attack that deals more than 30%% of its life it will shatter and be destroyed. 177 If a stoned creature if hit by an attack that deals more than 30%% of its life it will shatter and be destroyed.
  178 + Stoned creatures are highly resistant to fire and lightning and somewhat resistant to physical attacks.
178 At level 3 it will become a beam.]]):format(math.floor((3 + self:getTalentLevel(t)) / 1.5)) 179 At level 3 it will become a beam.]]):format(math.floor((3 + self:getTalentLevel(t)) / 1.5))
179 end, 180 end,
180 } 181 }
@@ -130,10 +130,16 @@ newEffect{ @@ -130,10 +130,16 @@ newEffect{
130 on_lose = function(self, err) return "#Target# is not stoned anymore.", "-Stoned" end, 130 on_lose = function(self, err) return "#Target# is not stoned anymore.", "-Stoned" end,
131 activate = function(self, eff) 131 activate = function(self, eff)
132 eff.tmpid = self:addTemporaryValue("stoned", 1) 132 eff.tmpid = self:addTemporaryValue("stoned", 1)
  133 + eff.resistsid = self:addTemporaryValue("resists", {
  134 + [DamageType.PHYSICAL]=20,
  135 + [DamageType.FIRE]=80,
  136 + [DamageType.LIGHTNING]=50,
  137 + })
133 eff.dur = self:updateEffectDuration(eff.dur, "stun") 138 eff.dur = self:updateEffectDuration(eff.dur, "stun")
134 end, 139 end,
135 deactivate = function(self, eff) 140 deactivate = function(self, eff)
136 self:removeTemporaryValue("stoned", eff.tmpid) 141 self:removeTemporaryValue("stoned", eff.tmpid)
  142 + self:removeTemporaryValue("resists", eff.resistsid)
137 end, 143 end,
138 } 144 }
139 145
@@ -118,16 +118,16 @@ bool _CheckGLSLProgramValid(GLuint program) @@ -118,16 +118,16 @@ bool _CheckGLSLProgramValid(GLuint program)
118 118
119 #define CHECKGLSLCOMPILE( Shader, file ) \ 119 #define CHECKGLSLCOMPILE( Shader, file ) \
120 if(!_CheckGLSLShaderCompile( Shader , file)) \ 120 if(!_CheckGLSLShaderCompile( Shader , file)) \
121 - exit(-1); 121 + return(0);
122 122
123 #define CHECKGLSLLINK( Program ) \ 123 #define CHECKGLSLLINK( Program ) \
124 if(!_CheckGLSLProgramLink( Program )) \ 124 if(!_CheckGLSLProgramLink( Program )) \
125 - exit(-1); 125 + return(0);
126 126
127 #define CHECKGLSLVALID( Program ) \ 127 #define CHECKGLSLVALID( Program ) \
128 glValidateProgramARB( Program ); \ 128 glValidateProgramARB( Program ); \
129 if(!_CheckGLSLProgramValid( Program )) \ 129 if(!_CheckGLSLProgramValid( Program )) \
130 - exit(-1); 130 + return(0);
131 131
132 132
133 133