Get config values without using return parameters

Many temporaries can be removed.
This commit is contained in:
phosit
2025-01-29 16:38:52 +01:00
parent 874c4d1c59
commit 1a8757660f
38 changed files with 252 additions and 379 deletions
@@ -1,4 +1,4 @@
/* Copyright (C) 2024 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -134,8 +134,7 @@ JS::Value GetEdgesOfStaticObstructionsOnScreenNearTo(const ScriptInterface& scri
Script::CreateArray(rq, &edgeList);
int edgeListIndex = 0;
float distanceThreshold = 10.0f;
CFG_GET_VAL("gui.session.snaptoedgesdistancethreshold", distanceThreshold);
const float distanceThreshold{g_ConfigDB.Get("gui.session.snaptoedgesdistancethreshold", 10.0f)};
CFixedVector2D entityPos(x, z);
std::vector<entity_id_t> entities = GetEntitiesWithStaticObstructionOnScreen();