MCPcopy Create free account
hub / github.com/demoth/jake2 / normalizeSkillCvar

Method normalizeSkillCvar

game/src/main/java/jake2/game/GameSpawn.java:986–997  ·  view source on GitHub ↗
(GameExportsImpl gameExports)

Source from the content-addressed store, hash-verified

984 }
985
986 private static float normalizeSkillCvar(GameExportsImpl gameExports) {
987 final float skill = gameExports.gameCvars.skill.value;
988 float skillNormalized = (float) Math.floor(skill);
989
990 if (skillNormalized < 0)
991 skillNormalized = 0;
992 if (skillNormalized > 3)
993 skillNormalized = 3;
994 if (skill != skillNormalized)
995 gameExports.gameImports.cvar_forceset("skill", "" + skillNormalized);
996 return skill;
997 }
998
999 /**
1000 * Finds the spawn function for the entity and calls it.

Callers 1

SpawnEntitiesMethod · 0.95

Calls 1

cvar_forcesetMethod · 0.65

Tested by

no test coverage detected