Closed kai-li-wop closed 1 year ago
I would go for the first solution: don't draw the icon as long as the health station is depleted. The icon is drawn in CG_DrawHealthstationIcon
which takes a centity_t type variable. The code in g_stations.c
uses s.angles[2]
to store the health status information of the health station: 0 for empty and 1 for full. CGAME should be able to use it somehow, but I don't know how. My approach would be to add the following view lines to CG_DrawHealthstationIcon
to skip the rest of the function if the health station is empty.
if (cent->s.angles2[2] == 0) {
return;
}
The thing is that s.angles2[2] is not available for centity_t but for gentity_t. How can I use this in CGAME?
Also, the icon should not be drawn if the health station is very close and visible to the player. I tried to implement this with 96e4081, which uses existing code. The code works so far, but only for one of all health stations in a map. I can't figure out why, since all stations should be passed through due to the loop that calls CG_DrawHealthstationIcon
.
Any suggestions @mgerhardy?
I just tried it out.
Seems to work fine.
Until now I've never realized that the Health Stations will only show up when you're under 50% health 😄
The icon also disappears when approaching the Health station like intended.
Seems a good solution without cluttering the players screen with unnecessary information.
@3aTmE: Can you please test if the icon disappears for all health stations in a map when you come close? On my side it only works for one station but not for all, which is kind of strange.
@kai-li-wop You're right!
Just checked it out and yes, the icon disappears only on one health station when you come closer to it.
OK, thx. I created a new ticket for this (#189) because it is not connected to this feature.
The icon for the HealthStation is currently also displayed when the station is currently empty. Of course, this is stupid if the player just runs into this station and finds it empty. I have 3 suggestions for solving this issue:
I think the first suggestion would probably be the easiest to implement.