Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CanShoot and IsFiring, correct hashed schema name, correct TICK_INTERVAL #38

Merged
merged 3 commits into from
Feb 21, 2024
Merged

Conversation

Exlodium
Copy link
Collaborator

No description provided.

@maecry
Copy link
Owner

maecry commented Feb 18, 2024

Hmm, I wouldn't use SDK::Cmd in this case, would be proper if you check it inside C_CSWeaponBaseGun

also C_CSPlayerPawnBase::m_bWaitForNoAttack = 0x13DC and CCSPlayer_WeaponServices::m_flNextAttack = 0xC0

so I'd do something like qo0 did

/// @param[in] flServerTime should always be this->GetTickBase()
/// @returns: true if player is ready to attack, false otherwise
bool C_CSPlayerPawnBase::CanAttack(const float flServerTime)
{ 
        // @test: should check GetWeaponServices() == nullptr?
	// check is player ready to attack
	if (this->IsWaitForNoAttack() || this->GetWeaponServices()->GetNextAttack() > flServerTime)
		return false;

	return true;
}

same apply to IsFiring but I'd do the same as qo0 https://github.com/rollraw/qo0-csgo/blob/590d2132374db3aa43d5ce656f6b3f34950430eb/base/sdk/entity.cpp#L552C24-L552C40

…imary/SecondaryAttack

also ItemDefinitionIndex_t for better code redability instead of using enum as a type, this should be fix for all the place in the base, however It will be rewrite in v2 soon
@maecry
Copy link
Owner

maecry commented Feb 21, 2024

since I haven't tested yet but YOLO merge as It should work!

@maecry maecry merged commit b48b6f6 into maecry:master Feb 21, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants