Skip to content

Fix botlib compiler warnings#291

Open
realMelTuc wants to merge 1273 commits intoactionquake:aqtionfrom
realMelTuc:fix/botlib-warnings
Open

Fix botlib compiler warnings#291
realMelTuc wants to merge 1273 commits intoactionquake:aqtionfrom
realMelTuc:fix/botlib-warnings

Conversation

@realMelTuc
Copy link

This PR fixes various compiler warnings in the botlib code as described in issue #290.

Changes Made:

  1. Remove unused variables in botlib_cmd.c, botlib_esp.c, botlib_movement.c, and botlib_spawn.c
  2. Fix wrong struct field type in g_local.h (char* to char)
  3. Add const qualifier to BOTLIB_NodeTouchNodes parameter
  4. Delete orphaned botlib_win.c file

Testing:

All changes are straightforward fixes for unused variables and type issues. No functional changes to the botlib code.

darkshade9 and others added 30 commits September 20, 2024 14:11
They cause some performance hit. Better to enable them separately for
re-release.
darkshade9 and others added 29 commits January 15, 2025 08:56
* Fixed one more warning

* This should fix maps with only one info_player_start spawn

* trying to fix a meson bug

* trying to fix a meson bug

* trying to fix a meson bug

* trying to fix a meson bug

* trying to fix a meson bug
* Moved gamemode server settings to Gamemode()

* Fixed some gamemodes, bots serverinfo

* Fixed 'atl' and 'etv' settings
* Fixed one more warning

* Added shot stats for punches and grenade throws
* Fixed one more warning

* auto_menu 2 prints the menu AFTER the motd is printed
* ctf_rewards added, replacing ctf_mode, fixed stat collection

* Models disappeared somehow

* vwep works

* Limiting briefcase pickup to guns isn't working yet

* Added two todos
* Fixed one more warning

* use_ghosts 2 to autoghost restore

* Fail early if ghosts isnt even enabled

* NULL check and doc update
…ctionquake#243)

* Automatic demo recording, including deathmatch, without lua needed

* Set ServerAutoRecordDemo to static

* Auto demo recording and sv_status_ext doc
* training mode bot spawnpoint initial support

* Added spawn settings for training mode

* A few more behavior flags, logic gates

* Initial minor success?

* Still some debug statements, but bots spawn in.. player doesn't

* Renamed training_mode to just training

* Segfaults look to be addressed

* Botflags are properly set

* Fixed a few edge cases

* Fixed respawning issue

* Added BOT_DUMMY and BOT_IGNORE_ALL aliases

* Minor cleanup

* Adjusted some training mode specific settings, and botflags

* Smarter about auto adding bots

* Keep the doors around in training mode

* Blocking idle sounds and auto disabling use_rewards

* Item drop timer reduce, giving bots only a knife to start with

* Fixed idle sounds played in training mode

* Reduced complexity of item/weapon respawn

* More elegant way to force item respawns

* Should finally silence insane sounds in training mode

* Testing if doors are causing bglass to pop

* Reverted door removal code

* Set glass to no_knockback to prevent movement

* Added comment in glass

* Experimental trigger_gravity changes

* Set the if statement above the trigger statement

* Trying CONTENTS_MIST as the 'vacuum of space' option

* Trying CONTENTS_MIST as the 'vacuum of space' option

* Added CONTENTS_MIST as part of MASK_WATER

* Revert "Added comment in glass"

This reverts commit 8efba3d.

* Reverted

* Fixed some training mode bugs
* Fixed one more warning

* Draft timeout feature

* Revert main.c changes

* Optional ref whistle sound, some minor changes

* Minor rearragement

* Grant the timeout before the next round begins

* Fixed a few critical bugs, added documentation
* CTF fixes, null checks

* More ctf_mode fixes
* Restored ctf_mode design

* If statement fix for CTB
* Add command to set/inspect custom fog.

* Don't add heatbeam particles if paused.

* Interpolate BFG lightramp in extended mode.

* Improve RandomDir() uniformity.

* Improve tracker shell effect.

Make entity black. Add more particles and make particles larger
depending on radius.

* Avoid NaNs in heightfog shader.

Fixes small ‘dead pixel’ artifacts visible in dark areas.

* Reduce indentation.

* Add re-release bloom effect support.

Based on code from: Jonathan <jonno.5000@gmail.com>
Suggestions by: @res2k

Closes #362.

* Delete program if it fails to compile/link.

Using incomplete program may crash the GPU.

* Clean up uniforms binding code.

* Fix uniforms block size mismatch.

ANGLE doesn't like it, but Nvidia/Mesa are fine with it.

* Add GL_BindBufferBase() wrapper.

* Remove unused argument.

* Make glStateBits_t 64-bit.

* Print shader source with ‘developer 3’.

* Add color shell to weapon model too.

* Improve visibility of typewritten strings.

* Update mgu6m2 checksum.

* Don't OR contents in CM_ClipEntity().

It turns out fire_lead() water detection logic has been broken all this
time due to this change. Revert to original Q2 behavior.

* Fix BFG laser sparks color.

* Fix PSX skies.

* Draw PSX flare as default flare.

* Better smoothing of short steps.

* Re-add debug graph support.

Can still be useful for some things. Also include packet size mode from
R1Q2.

* Update libcurl to 8.11.0.

* Turn ‘PF_cprintf to a non-client’ error into warning.

No reason for this to be an error when other similar conditions are
warnings.

* Don't put shadows on alpha surfaces.

* Use separate cvar for skybox texture filter.

Skybox textures are typically very low-res, and having them nearest
filtered can be undesirable even if the rest of textures are.

* Remove unneeded image type bit.

* Reset flare visibility if entity disappeared.

Prevents previously visible flares from popping up behind the wall. Use
2.5 sec timeout so that flashing flares still work.

* Scale flares up with distance for occlusion.

* Fix BFG lightramp lerp with variable FPS.

Regression since 9e99f37.

* Add N64 electric sparks effect.

Partially based on:
Paril@fd255ef

* Only print 24-bit PCX warning in developer mode.

* Fix broken maps that set skyrotate but not skyaxis.

* Only call GL_InitFramebuffers() if using shaders.

* Allow arbitrary length image extensions.

Don't just assume 3 chars. Allows some broken maps to work.

* Only print game API warnings in developer mode.

* Mask vwep index with 255 in extended mode.

More data may be packed after it in the future.

* Fix misrendered window icon

* Add missing parens for Com_DWPrintf

Ran into this when trying to make a release build from ade82fd

* Add clipmask parameter to new pmove trace function.

Allows ladders to work more reliably in some re-release maps.

* Update comments.

* Merge brush contents into solid leaf contents.

Fixes annoying issue with CONTENTS_LADDER tracing not working as
expected, because solid leafs only have CONTENTS_SOLID bit.

To avoid regressions, only do this in extended protocol mode.

* Remove ill-defined ‘map_allsolid_bug’ cvar.

It could cause prediction misses if desynced between client/server.

* Reduce size of mnode_t/mleaf_t.

* Print missing models with ‘developer 2’.

* Build some CI targets in release mode.

To catch errors like 0b790d7.

* Cast zlib malloc size to size_t before multiply.

* Support scaling sprites too.

* Interpolate blend in extended mode.

* Remove unused defines.

* Add BSPX header presence flag.

* Ignore SURF_NODRAW bit in vanilla maps.

Commit 0dbe1bb disabled rendering of NODRAW surfaces in attempt to fix
re-release maps, but this in turn broke vanilla maps which have NODRAW
bit randomly set on visible surfaces.

Only account for NODRAW if map has BSPX header.

Originally reported in Paril#132.

* Allow lightmapped SURF_FLOWING faces.

These are allowed to have lightmaps in vanilla Q2.

* Show surface flags for ‘cl_surface’ macro.

* Remove fake sky faces if using cubemaps.

Some vanilla maps use fake sky faces for lighting and backface culling.
These faces should be invisible, and must be removed if using cubemaps.

Originally reported in Paril#132.

* Calc vertex buffer size after removing sky faces.

* Consider more flags for N64 detection.

* Align code for readability.

* Ignore prediction misses of 1/8 units or less.

Prevents tiny oscillations when standing on top of another entity in
some cases. Follow-up fix to d019074.

* Fix race condition when retrieving thread return value.

Return value is not used anywhere currently.

* Rename CHAR_WIDTH to CONCHAR_WIDTH.

Prevents conflict with limits.h when compiling in C23 mode. Also rename
CHAR_HEIGHT.

* Better protect against multiple nextserver commands.

Users could kill the server by sending multiple nextserver
commands with crafted spawncount.

* Change debug level comparisons to >= for readability.

* Add shadow alpha fading with distance.

Also fix wrong projected point being used for shadow culling.

* Count culled shadows separately.

* Const-ify server state pointers in client_t.

* Assert input field buffer is nul-terminated.

* Update libcurl to 8.11.1.

* Update libjpeg-turbo to 3.1.0.

* More strictly check stat index bounds.

Don't allow referencing stats >= 32 without protocol extensions.

* Tweak BSP feature detection logic a bit.

Lightmapped liquids are compiler specific feature independent from
DECOUPLED_LM. Make them depend on BSPX header instead.

Also restrict bmodel skies to BSPX maps only, not N64.

* Skip cinematic demos if running coop server.

Hack to prevent the server from being killed if mod uses demos as
cinematics. Serving demos to multiple clients has never worked
in vanilla Q2 anyway.

* Skip cinematic existence check if running dedicated server.

* Move CRC to common code, expose CRC_Block().

* Support hashed format for entity string overrides.

For compatibility with YQ2 mapfixes.

* Fixed a few warnings and one error

* Fixed CON_WIDTH error

---------

Co-authored-by: Andrey Nazarov <skuller32@gmail.com>
Co-authored-by: Karolis Stasaitis <contact@carlossless.io>
* Auto download map once if local copy does not match server

* Hopefully fixing client autodnld bug
* Testing a fix to the dead body projectile blocking bug

* Added use_buggy_ent_hitbox to toggle this feature

* Added documentation

* Refined docs
* Decoupled gl_dynamic

* Added documentation

* Null cvar deref fix
- Remove unused variable in botlib_cmd.c:13 (int cc)
- Remove unused variable in botlib_esp.c:18 (edict_t *target)
- Remove unused variable in botlib_movement.c:140 (qboolean foundProblem)
- Remove unused variables in botlib_spawn.c:329 (int prev_bots_skipped) and :1728 (int i)
- Fix wrong struct field type in g_local.h:870 (char* -> char)
- Add const qualifier to BOTLIB_NodeTouchNodes parameter to fix -Wincompatible-pointer-types-discards-qualifiers
- Delete orphaned botlib_win.c file (duplicate of seed_random_number_generator)
@realMelTuc
Copy link
Author

This PR fixes issue #290 - Fix botlib compiler warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants