diff options
Diffstat (limited to '')
| -rw-r--r-- | src/menu.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/menu.cpp b/src/menu.cpp index 1ef8638..41d3321 100644 --- a/src/menu.cpp +++ b/src/menu.cpp | |||
| @@ -729,6 +729,24 @@ void outer_draw() { | |||
| 729 | bool esp_on = feature_active(FEAT_ESP); | 729 | bool esp_on = feature_active(FEAT_ESP); |
| 730 | if (!g_surface || (!g_menu_open && !draw_test && !esp_on)) | 730 | if (!g_surface || (!g_menu_open && !draw_test && !esp_on)) |
| 731 | return; | 731 | return; |
| 732 | |||
| 733 | // Level/menu -> game transitions can invalidate the VGUI font handle. | ||
| 734 | // Recreate it when the local player entity changes (menu -> map, map load). | ||
| 735 | static void *last_local = nullptr; | ||
| 736 | bool font_reset = false; | ||
| 737 | if (g_iface.entitylist) { | ||
| 738 | int local = engine_get_local_player(); | ||
| 739 | void *le = local > 0 ? entitylist_get(local) : nullptr; | ||
| 740 | if (le != last_local) { | ||
| 741 | last_local = le; | ||
| 742 | font_reset = true; | ||
| 743 | } | ||
| 744 | } | ||
| 745 | if (font_reset && g_font) { | ||
| 746 | g_font = 0; | ||
| 747 | logf("font: reset (local entity change)"); | ||
| 748 | } | ||
| 749 | |||
| 732 | if (!g_font) { | 750 | if (!g_font) { |
| 733 | static const char *families[] = { | 751 | static const char *families[] = { |
| 734 | "Liberation Sans", "DejaVu Sans", "Noto Sans", "Tahoma", | 752 | "Liberation Sans", "DejaVu Sans", "Noto Sans", "Tahoma", |
