Some issues:
static int Einschlagsnummer;
Is never default initialized. Some code paths return nothing so whatever is in [e]ax gets returned, which may be 1. If Trefferchance is <= 80 and m_Schutzwall > 5, it will return 1 for each iteration up to five. However, you stated that m_Schutzwall is 1 which means it's never decremented to zero since the test is for m_Schutzwall > 1, not m_Schutzwall >= 1. This suggests that the return value is likely what happens to be in [e]ax. now nitpicking:
int Zufallstreffer;
Zufallstreffer=rand()%99+1;
int Trefferchance;
Trefferchance=rand()%99+1;
Why not initialize the variables in the declaration of them? Why
m_Schutzwall=m_Schutzwall-1;
instead of --m_Schutzwall;