Эксперт
-
Автор темы
- #1
половину я сам сделал, а остальное не получается.
объясните подробно как это исправить, пожалуйста.
Код:
void misc::quickReload(CUserCmd* cmd)
{
if (g_cfg.misc.quickReload) {
static Entity* reloadedWeapon{ nullptr };
if (reloadedWeapon) {
for (auto weaponHandle : localPlayer->weapons()) {
if (weaponHandle == -1)
break;
if (interfaces->entityList->getEntityFromHandle(weaponHandle) == reloadedWeapon) {
cmd->m_weaponselect = reloadedWeapon->index();
cmd->m_weaponsubtype = reloadedWeapon->getWeaponSubType();
break;
}
}
reloadedWeapon = nullptr;
}
if (auto activeWeapon{ localPlayer->getActiveWeapon() }; activeWeapon && activeWeapon->isInReload() && activeWeapon->clip() == activeWeapon->getWeaponData()->maxClip) {
reloadedWeapon = activeWeapon;
for (auto weaponHandle : localPlayer->weapons()) {
if (weaponHandle == -1)
break;
if (auto weapon{ interfaces->entityList->getEntityFromHandle(weaponHandle) }; weapon && weapon != reloadedWeapon) {
cmd->m_weaponselect = weapon->index();
cmd->m_weaponsubtype = weapon->getWeaponSubType();
break;
}
}
}
}
}