Skip to content
This repository has been archived by the owner on Nov 6, 2021. It is now read-only.

Commit

Permalink
Minor fixes in shared.h, figured using doubles might be best in there…
Browse files Browse the repository at this point in the history
…. Also removed an accidental #if #else its else situation, causing enities to never think.... (That's bad for business.)
  • Loading branch information
WatIsDeze committed Nov 4, 2021
1 parent c9272a4 commit 7214e16
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 38 deletions.
8 changes: 4 additions & 4 deletions bin/basepoly/polyconfig.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ bind END "centerview"
bind MOUSE1 "+attack"
bind MOUSE2 "+strafe"
bind MOUSE3 "+forward"
seta _ui_nextserver "nac_campgrounds"
seta _ui_nextserver "test_stepmove"
seta _vid_fullscreen "24"
seta adr0 "160.20.147.121:27910"
seta adr1 ""
Expand Down Expand Up @@ -142,7 +142,7 @@ seta m_invert "0"
seta m_pitch "0.15"
seta maxclients "8"
seta msg "1"
seta name "l4wd 0f t3h n00bz"
seta name "l4wd 0f t3h n00"
seta ogg_enable "1"
seta ogg_ignoretrack0 "0"
seta ogg_shuffle "0"
Expand Down Expand Up @@ -178,7 +178,7 @@ seta s_underwater "1"
seta s_underwater_gain_hf "0.25"
seta s_voiceinput "0"
seta s_voiceinput_volume "1"
seta s_volume "1"
seta s_volume "0.800000"
seta scr_alpha "0.800000"
seta scr_fps "2"
seta scr_lag_draw "1"
Expand All @@ -190,7 +190,7 @@ seta sli "1"
seta sun_azimuth "345"
seta sun_elevation "45"
seta sun_latitude "32.9"
seta sun_preset "7"
seta sun_preset "6"
seta tm_blend_enable "1"
seta tm_exposure_bias "-1.800000"
seta ui_scale "2"
Expand Down
22 changes: 11 additions & 11 deletions inc/shared/shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,18 @@ constexpr int32_t WORLD_SIZE = (MAX_WORLD_COORD - MIN_WORLD_COORD);
#if TICK_RATE_STYLE == 1
static constexpr uint32_t BASE_FRAMERATE = 10;
static constexpr double BASE_FRAMETIME = 100;
static constexpr double BASE_1_FRAMETIME = 0.01f; // 1/BASE_FRAMETIME
static constexpr double BASE_FRAMETIME_1000 =0.1f; // BASE_FRAMETIME/1000
static constexpr double BASE_1_FRAMETIME = 0.01; // 1/BASE_FRAMETIME
static constexpr double BASE_FRAMETIME_1000 =0.1; // BASE_FRAMETIME/1000
#endif

//-----------------
//N&C 20hz tick
//-----------------
#if TICK_RATE_STYLE == 2
static constexpr uint32_t BASE_FRAMERATE = 20; //10
static constexpr double BASE_FRAMETIME = 50.0f; //100
static constexpr double BASE_1_FRAMETIME = 0.02f; //0.01f // 1/BASE_FRAMETIME
static constexpr double BASE_FRAMETIME_1000 = 0.05f; //0.1f // BASE_FRAMETIME/1000
static constexpr double BASE_FRAMETIME = 50.0; //100
static constexpr double BASE_1_FRAMETIME = 0.02; //0.01f // 1/BASE_FRAMETIME
static constexpr double BASE_FRAMETIME_1000 = 0.05; //0.1f // BASE_FRAMETIME/1000
#endif
//-----------------
//N&C 30hz tick
Expand All @@ -239,18 +239,18 @@ static constexpr double BASE_FRAMETIME_1000 = 0.03333333333; //0.1f // BA
//-----------------
#if TICK_RATE_STYLE == 4
static constexpr uint32_t BASE_FRAMERATE = 40; //10
static constexpr float BASE_FRAMETIME = 25.0f; //100
static constexpr float BASE_1_FRAMETIME = 0.04f; //0.01f // 1/BASE_FRAMETIME
static constexpr float BASE_FRAMETIME_1000 = 0.025f; //0.1f // BASE_FRAMETIME/1000
static constexpr double BASE_FRAMETIME = 25.0; //100
static constexpr double BASE_1_FRAMETIME = 0.04; //0.01f // 1/BASE_FRAMETIME
static constexpr double BASE_FRAMETIME_1000 = 0.025; //0.1f // BASE_FRAMETIME/1000
#endif
//-----------------
//N&C 60hz tick
//-----------------
#if TICK_RATE_STYLE == 5
static constexpr uint32_t BASE_FRAMERATE = 60; //10
static constexpr float BASE_FRAMETIME = 16.6666666667; //100
static constexpr float BASE_1_FRAMETIME = 0.05999999999; //0.01f // 1/BASE_FRAMETIME
static constexpr float BASE_FRAMETIME_1000 = 0.01666666666; //0.1f // BASE_FRAMETIME/1000
static constexpr double BASE_FRAMETIME = 16.6666666667; //100
static constexpr double BASE_1_FRAMETIME = 0.05999999999; //0.01f // 1/BASE_FRAMETIME
static constexpr double BASE_FRAMETIME_1000 = 0.01666666666; //0.1f // BASE_FRAMETIME/1000
#endif

//-----------------
Expand Down
47 changes: 24 additions & 23 deletions src/svgame/physics/physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,30 +105,31 @@ qboolean SVG_RunThink(SVGBaseEntity *ent)

ent->SetNextThinkTime(0);

#if _DEBUG
if ( !ent->HasThinkCallback() ) {
// Write the index, programmers may look at that thing first
std::string errorString = "entity (index ";
errorString += std::to_string( ent->GetNumber() );

// Write the targetname as well, if it exists
if ( !ent->GetTargetName().empty() ) {
errorString += ", name '" + ent->GetTargetName() + "'";
}

// Write down the C++ class name too
errorString += ", class '";
errorString += ent->GetTypeInfo()->className;
errorString += "'";
//#if _DEBUG
//if ( !ent->HasThinkCallback() ) {
// // Write the index, programmers may look at that thing first
// std::string errorString = "entity (index ";
// errorString += std::to_string( ent->GetNumber() );

// // Write the targetname as well, if it exists
// if ( !ent->GetTargetName().empty() ) {
// errorString += ", name '" + ent->GetTargetName() + "'";
// }

// // Write down the C++ class name too
// errorString += ", class '";
// errorString += ent->GetTypeInfo()->className;
// errorString += "'";

// // Close it off and state what's actually going on
// errorString += ") has a nullptr think callback" \n;
//
// gi.Error( errorString.c_str() );
//}
//#endif

ent->Think();

// Close it off and state what's actually going on
errorString += ") has a nullptr think callback";

gi.Error( errorString.c_str() );
}
#else
ent->Think();
#endif

return false;
}
Expand Down

0 comments on commit 7214e16

Please sign in to comment.