- avoid using ptrdiff_t in templated contexts.

Some systems map this to 'long' instead of 'long long' and not everything provides handlers for this type.
This commit is contained in:
Christoph Oelckers 2020-10-21 19:19:45 +02:00
parent 9cdaaff42b
commit 9440bc0c6d
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ extern FixedBitArray<MAXSPRITES> activeSprites;
template<> FSerializer& Serialize(FSerializer& arc, const char* key, Duke3d::weaponhit*& ht, Duke3d::weaponhit** def) template<> FSerializer& Serialize(FSerializer& arc, const char* key, Duke3d::weaponhit*& ht, Duke3d::weaponhit** def)
{ {
ptrdiff_t index = ht? ht - Duke3d::hittype : -1; int index = ht? int(ht - Duke3d::hittype) : -1;
assert(index >= -1 && index < MAXSPRITES); assert(index >= -1 && index < MAXSPRITES);
Serialize(arc, key, index, nullptr); Serialize(arc, key, index, nullptr);
ht = index < 0? nullptr : &Duke3d::hittype[index]; ht = index < 0? nullptr : &Duke3d::hittype[index];