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:
helixhorned 2012-01-30 18:25:13 +00:00
parent e0163fcbcd
commit 021126045f

View file

@ -5073,7 +5073,8 @@ end_after_dragging:
} }
else if ((pointhighlight&0xc000) == 16384) 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; vec3_t vec, ovec;
Bmemcpy(&ovec, (vec3_t *)&sprite[daspr], sizeof(vec3_t)); Bmemcpy(&ovec, (vec3_t *)&sprite[daspr], sizeof(vec3_t));
@ -5081,24 +5082,23 @@ end_after_dragging:
vec.y = day; vec.y = day;
vec.z = sprite[daspr].z; vec.z = sprite[daspr].z;
if (setspritez(daspr, &vec) == -1 && osec>=0) if (setspritez(daspr, &vec) == -1 && osec>=0)
Bmemcpy(&sprite[daspr], &ovec, sizeof(vec3_t)); {
#if 0 updatesector_onlynextwalls(dax, day, &nsec);
daz = spriteheight(daspr, NULL);
for (i=0; i<numsectors; i++) if (nsec >= 0)
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].x = dax;
sprite[daspr].y = day; sprite[daspr].y = day;
if (sprite[daspr].sectnum != i) // z updating is after we released the mouse button
changespritesect(daspr,(int16_t)i); if (sprite[daspr].sectnum != nsec)
break; changespritesect(daspr, nsec);
} }
#endif else
Bmemcpy(&sprite[daspr], &ovec, sizeof(vec3_t));
} }
} }
}
asksave = 1; asksave = 1;
} }
} }