MCPcopy Create free account
hub / github.com/TurningWheel/Barony / monsterDebugModels

Function monsterDebugModels

src/actmonster.cpp:14924–15408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14922
14923static ConsoleVariable<bool> cvar_monster_debug_models("/monster_debug_models", false);
14924bool monsterDebugModels(Entity* my, real_t* dist)
14925{
14926#ifdef NDEBUG
14927 return false;
14928#endif
14929 if ( !*cvar_monster_debug_models )
14930 {
14931 return false;
14932 }
14933 static Uint32 thisTick = 0;
14934 if ( thisTick == ticks )
14935 {
14936 return false;
14937 }
14938 thisTick = ticks;
14939 if ( !my )
14940 {
14941 return false;
14942 }
14943 Stat* myStats = my->getStats();
14944 if ( !myStats )
14945 {
14946 return false;
14947 }
14948#ifndef NDEBUG
14949 static bool forceWalk = false;
14950 if ( keystatus[SDLK_KP_5] )
14951 {
14952 keystatus[SDLK_KP_5] = 0;
14953 forceWalk = !forceWalk;
14954 }
14955 if ( keystatus[SDLK_KP_6] )
14956 {
14957 keystatus[SDLK_KP_6] = 0;
14958 myStats->setEffectValueUnsafe(EFF_STUNNED, myStats->getEffectActive(EFF_STUNNED) ? 0 : 1);
14959 }
14960 if ( keystatus[SDLK_KP_PLUS] )
14961 {
14962 my->fskill[0] += 0.05;
14963 }
14964 if ( keystatus[SDLK_KP_MINUS] )
14965 {
14966 my->fskill[0] -= 0.05;
14967 }
14968 if ( forceWalk )
14969 {
14970 if ( dist )
14971 {
14972 *dist = 0.15;
14973 }
14974 }
14975
14976 if ( keystatus[SDLK_9] )
14977 {
14978 keystatus[SDLK_9] = 0;
14979 if ( myStats->helmet )
14980 {
14981 myStats->helmet->appearance++;

Callers 5

monsterSMoveBodypartsFunction · 0.85
monsterMMoveBodypartsFunction · 0.85
monsterGMoveBodypartsFunction · 0.85
monsterDMoveBodypartsFunction · 0.85
gnomeMoveBodypartsFunction · 0.85

Calls 6

list_RemoveNodeFunction · 0.85
setEffectValueUnsafeMethod · 0.80
attackMethod · 0.80
getAttackPoseMethod · 0.80
newItemFunction · 0.70
getStatsMethod · 0.45

Tested by

no test coverage detected