Utilize dynamiclight_spawnstatic on csaddon and fixes a problem with spawning lights on x64 builds (#293)
* Fixed first 32 lights not working on csaddon on 64 bits builds * Added a comment back... * fix the fix for the comment. I love Git * double check that the new selectedlight is not the same as the old selectedlight (oldl) just in case.
This commit is contained in:
parent
b0e74e893c
commit
4b943f9a9e
1 changed files with 34 additions and 43 deletions
|
@ -383,14 +383,13 @@ float(float keyc, float unic, vector m) editor_lights_key =
|
|||
}
|
||||
else if (unic == 'i' || unic == 'I')
|
||||
{
|
||||
traceline(o, t, TRUE, world);
|
||||
float oldl = selectedlight;
|
||||
for (selectedlight = 32; ; selectedlight+=1)
|
||||
selectedlight = dynamiclight_spawnstatic(trace_endpos + trace_plane_normal*4f, 300, '1 1 1');
|
||||
|
||||
if ((float)dynamiclight_get(oldl, LFIELD_RADIUS) != 0f && oldl != selectedlight)
|
||||
{
|
||||
if (!(float)dynamiclight_get(selectedlight, LFIELD_RADIUS))
|
||||
{
|
||||
if (oldl >= 32 && (!((float)dynamiclight_get(selectedlight, LFIELD_RADIUS) > 50)))
|
||||
{
|
||||
/*dupe the current light*/
|
||||
//dupe the current light
|
||||
dynamiclight_set(selectedlight, LFIELD_RADIUS, dynamiclight_get(oldl, LFIELD_RADIUS));
|
||||
dynamiclight_set(selectedlight, LFIELD_COLOUR, dynamiclight_get(oldl, LFIELD_COLOUR));
|
||||
dynamiclight_set(selectedlight, LFIELD_FOV, dynamiclight_get(oldl, LFIELD_FOV));
|
||||
|
@ -404,8 +403,7 @@ float(float keyc, float unic, vector m) editor_lights_key =
|
|||
dynamiclight_set(selectedlight, LFIELD_CORONA, dynamiclight_get(oldl, LFIELD_CORONA));
|
||||
dynamiclight_set(selectedlight, LFIELD_CORONASCALE, dynamiclight_get(oldl, LFIELD_CORONASCALE));
|
||||
dynamiclight_set(selectedlight, LFIELD_ROTATION, dynamiclight_get(oldl, LFIELD_ROTATION));
|
||||
}
|
||||
else
|
||||
}else
|
||||
{
|
||||
/*reset the light's properties*/
|
||||
dynamiclight_set(selectedlight, LFIELD_RADIUS, 300);
|
||||
|
@ -422,13 +420,6 @@ float(float keyc, float unic, vector m) editor_lights_key =
|
|||
dynamiclight_set(selectedlight, LFIELD_CORONASCALE, 1);
|
||||
dynamiclight_set(selectedlight, LFIELD_ROTATION, '0 0 0');
|
||||
}
|
||||
|
||||
/*place it at the pointed location*/
|
||||
traceline(o, t, TRUE, world);
|
||||
dynamiclight_set(selectedlight, LFIELD_ORIGIN, trace_endpos + trace_plane_normal*4f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (unic == '[')
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue