if(!g_Config.m_SvOldLaser)
{
if(m_PrevPos != HitPos)
{
Temp = pHit->Core()->m_Vel + normalize(m_PrevPos - HitPos) * Strength;
pHit->Core()->m_Vel = ClampVel(pHit->m_MoveRestrictions, Temp);
}
else
{
pHit->Core()->m_Vel = StackedLaserShotgunBugSpeed;
}
}
(edited) CSnapshotBuilder Builder;
Builder.Init();
const int ObjCharSize = 88;
const int CharID = 0;
void *pObj = Builder.NewItem(NETOBJTYPE_CHARACTER, CharID, ObjCharSize);
mem_zero(pObj, ObjCharSize);
CSnapshot SnapDestPlaceHolder;
Builder.Finish(&SnapDestPlaceHolder);
dbg_msg("snap_trans", "<<<<< DUMP START >>>>>>>>>>>>");
SnapDestPlaceHolder.DebugDump();
dbg_msg("snap_trans", "<<<<< DUMP END >>>>>>>>>>>>");
NewItem
i printed the items memory address when its being added 2023-02-09 11:31:00 I new_item: pObj=0x7ffcddb38410 set type and id to (9 << 16) | 0 == 589824
CSnapshotItem::ID()
getter i printed where its looking up the id [item] &m_TypeAndID = 0x7ffcddb38414
protocol7::CNetObj_Character Char;
mem_zero(&Char, ObjCharSize);
Char.m_X = 1;
Char.m_Y = 1;
mem_copy(pObj, &Char, ObjCharSize);
setting data works wonderfullymem_zero(&Char, ObjCharSize);
mem_copy(pObj, &Char, ObjCharSize);
where this also zeros the type and id?mem_zero(pObj, ObjCharSize);
mem_zero(&Char, ObjCharSize);
mem_copy(pObj, &Char, ObjCharSize);
mem_zero(pObj, ObjCharSize);
ub? CSnapshotBuilder Builder;
Builder.Init();
const int ObjCharSize = 88;
const int CharID = 22;
void *pObj = Builder.NewItem(NETOBJTYPE_CHARACTER, CharID, ObjCharSize);
mem_zero(pObj, ObjCharSize);
unsigned char aTmpBuffer3[CSnapshot::MAX_SIZE];
CSnapshot *pTmpBuffer3 = (CSnapshot *)aTmpBuffer3;
Builder.Finish(pTmpBuffer3);
dbg_msg("snap_trans", "<<<<< DUMP START >>>>>>>>>>>>");
pTmpBuffer3->DebugDump();
dbg_msg("snap_trans", "<<<<< DUMP END >>>>>>>>>>>>");
seems like the builder doesnt like writing into some simple CSnapshot
on the stackCSnapshot
i should be able to generate a new 0.6 CSnapshot
not sure tho where to store it and who allocates memory for it and who frees it the whole snapshot storage prev/current/alt is not making much sense to meCSnapshot *m_pTransSnap
here that holds the snap that was translated from 0.7 to 0.6 https://github.com/ddnet/ddnet/blob/911bd0e69a8fee9b02f0cea26d50ecc2f000bc3c/src/engine/shared/snapshot.h#L123It is under development so don't expect anything yet.
more like It's not