MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / HacksComp_Update

Function HacksComp_Update

src/EntityComponents.c:236–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void HacksComp_Update(struct HacksComp* hacks) {
237 if (!hacks->CanFly || !hacks->Enabled) {
238 HacksComp_SetFlying(hacks, false);
239 hacks->FlyingDown = false; hacks->FlyingUp = false;
240 }
241 if (!hacks->CanNoclip || !hacks->Enabled) {
242 HacksComp_SetNoclip(hacks, false);
243 }
244 if (!hacks->CanSpeed || !hacks->Enabled) {
245 hacks->Speeding = false; hacks->HalfSpeeding = false;
246 }
247
248 hacks->CanDoubleJump = hacks->Enabled && hacks->CanSpeed;
249 Event_RaiseVoid(&UserEvents.HackPermsChanged);
250}
251
252void HacksComp_SetFlying(struct HacksComp* hacks, cc_bool flying) {
253 if (hacks->Flying == flying) return;

Callers 4

ClO_SetHacksFunction · 0.85
HS_SetHacksFunction · 0.85
HacksComp_RecheckFlagsFunction · 0.85
CPE_HackControlFunction · 0.85

Calls 3

HacksComp_SetFlyingFunction · 0.85
HacksComp_SetNoclipFunction · 0.85
Event_RaiseVoidFunction · 0.85

Tested by

no test coverage detected