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

Function HacksComp_RecheckFlags

src/EntityComponents.c:215–234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215void HacksComp_RecheckFlags(struct HacksComp* hacks) {
216 /* Can use hacks by default (also case with WoM), no need to check +hax */
217 cc_bool hax = !String_ContainsConst(&hacks->HacksFlags, "-hax");
218 HacksComp_SetAll(hacks, hax);
219 hacks->CanBePushed = true;
220
221 HacksComp_ParseFlag(hacks, "+fly", "-fly", &hacks->CanFly);
222 HacksComp_ParseFlag(hacks, "+noclip", "-noclip", &hacks->CanNoclip);
223 HacksComp_ParseFlag(hacks, "+speed", "-speed", &hacks->CanSpeed);
224 HacksComp_ParseFlag(hacks, "+respawn", "-respawn", &hacks->CanRespawn);
225 HacksComp_ParseFlag(hacks, "+push", "-push", &hacks->CanBePushed);
226 HacksComp_ParseFlag(hacks, "+thirdperson", "-thirdperson", &hacks->CanUseThirdPerson);
227 HacksComp_ParseFlag(hacks, "+names", "-names", &hacks->CanSeeAllNames);
228
229 if (hacks->IsOp) HacksComp_ParseAllFlag(hacks, "+ophax", "-ophax");
230 hacks->BaseHorSpeed = HacksComp_ParseFlagFloat("horspeed=", hacks);
231 hacks->MaxHorSpeed = HacksComp_ParseFlagFloat("maxspeed=", hacks);
232 hacks->MaxJumps = HacksComp_ParseFlagInt("jumps=", hacks);
233 HacksComp_Update(hacks);
234}
235
236void HacksComp_Update(struct HacksComp* hacks) {
237 if (!hacks->CanFly || !hacks->Enabled) {

Callers 2

Classic_HandshakeFunction · 0.85
Classic_SetPermissionFunction · 0.85

Calls 6

HacksComp_SetAllFunction · 0.85
HacksComp_ParseFlagFunction · 0.85
HacksComp_ParseAllFlagFunction · 0.85
HacksComp_ParseFlagFloatFunction · 0.85
HacksComp_ParseFlagIntFunction · 0.85
HacksComp_UpdateFunction · 0.85

Tested by

no test coverage detected