-
Автор темы
- #1
Тут такое дело, не знаю как получить GetSequenceActivity, именно в классе CBaseViewModel:/
C++:
CRecvProxyData* pData = const_cast<CRecvProxyData*>(pDataConst);
CBaseViewModel* pViewModel = (CBaseViewModel*)pStruct;
if (pViewModel)
{
IClientEntity* pOwner = I::EntityList()->GetClientEntityFromHandle((PVOID)pViewModel->GetOwner());
if (pOwner && pOwner->EntIndex() == I::Engine()->GetLocalPlayer())
{
int ModelIndex = pViewModel->GetModelIndex();
int Sequence = pData->m_Value.m_Int;
int originalActivity = pViewModel->GetSequenceActivity(Sequence); // Get the original sequence activity
pViewModel->SetModelIndex(ModelIndex); // change model to the new model/knife
int newActivity = 1;
int num = 0;
for (size_t i = 0; i < 20; i++) {
int tempActitivity = pViewModel->GetSequenceActivity(i);
if (originalActivity != -1 && originalActivity == tempActitivity || originalActivity == -1 && tempActitivity == 213) {
newActivity = i;
for (size_t t = 0; t < 4; t++) {
if (pViewModel->GetSequenceActivity(i + t) == tempActitivity)
num++;
}
break;
}
}
if (originalActivity == -1 && newActivity == 1)
newActivity = Sequence;
if (!num)
Sequence = newActivity;
else
Sequence = random_sequence(newActivity, newActivity + num - 1);
pViewModel->SendViewModelMatchingSequence(Sequence); // this sets the sequence and resets the sequence timings.
pData->m_Value.m_Int = Sequence;
Последнее редактирование: