mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Mapster32: tweak dragging a single sprite so that they can be dragged 'uphill'.
The implementation uses the recently introduced updatesector_onlynextwall when setspritez fails. git-svn-id: https://svn.eduke32.com/eduke32@2302 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e0163fcbcd
commit
021126045f
1 changed files with 16 additions and 16 deletions
|
@ -5073,7 +5073,8 @@ end_after_dragging:
|
|||
}
|
||||
else if ((pointhighlight&0xc000) == 16384)
|
||||
{
|
||||
int32_t daspr=pointhighlight&16383, osec=sprite[daspr].sectnum;
|
||||
int32_t daspr=pointhighlight&16383;
|
||||
int16_t osec=sprite[daspr].sectnum, nsec=osec;
|
||||
vec3_t vec, ovec;
|
||||
|
||||
Bmemcpy(&ovec, (vec3_t *)&sprite[daspr], sizeof(vec3_t));
|
||||
|
@ -5081,24 +5082,23 @@ end_after_dragging:
|
|||
vec.y = day;
|
||||
vec.z = sprite[daspr].z;
|
||||
if (setspritez(daspr, &vec) == -1 && osec>=0)
|
||||
Bmemcpy(&sprite[daspr], &ovec, sizeof(vec3_t));
|
||||
#if 0
|
||||
daz = spriteheight(daspr, NULL);
|
||||
{
|
||||
updatesector_onlynextwalls(dax, day, &nsec);
|
||||
|
||||
for (i=0; i<numsectors; i++)
|
||||
if (inside(dax,day,i) == 1)
|
||||
if (sprite[daspr].z >= getceilzofslope(i,dax,day))
|
||||
if (sprite[daspr].z-daz <= getflorzofslope(i,dax,day))
|
||||
{
|
||||
sprite[daspr].x = dax;
|
||||
sprite[daspr].y = day;
|
||||
if (sprite[daspr].sectnum != i)
|
||||
changespritesect(daspr,(int16_t)i);
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
if (nsec >= 0)
|
||||
{
|
||||
sprite[daspr].x = dax;
|
||||
sprite[daspr].y = day;
|
||||
// z updating is after we released the mouse button
|
||||
if (sprite[daspr].sectnum != nsec)
|
||||
changespritesect(daspr, nsec);
|
||||
}
|
||||
else
|
||||
Bmemcpy(&sprite[daspr], &ovec, sizeof(vec3_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
asksave = 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue