Przeglądaj źródła

a couple checks here and there to remove possible warnings.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16190 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 13 lat temu
rodzic
commit
aef07ec007
1 zmienionych plików z 6 dodań i 5 usunięć
  1. 6 5
      src/map/status.c

+ 6 - 5
src/map/status.c

@@ -8690,7 +8690,8 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
 			if (sce->val4) { //Clear the group.
 				struct skill_unit_group* group = skill_id2group(sce->val4);
 				sce->val4 = 0;
-				skill_delunitgroup(group);
+				if( group ) /* might have been cleared before status ended, e.g. land protector */
+					skill_delunitgroup(group);
 			}
 			break;
 		case SC_KAAHI:
@@ -8773,18 +8774,18 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
 			break;
 		case SC_NEUTRALBARRIER_MASTER:
 		case SC_STEALTHFIELD_MASTER:
-			if( sce->val2 )
-			{
+			if( sce->val2 ) {
 				struct skill_unit_group* group = skill_id2group(sce->val2);
 				sce->val2 = 0;
-				skill_delunitgroup(group);
+				if( group ) /* might have been cleared before status ended, e.g. land protector */
+					skill_delunitgroup(group);
 			}
 			break;
 		case SC_BANDING:
 				if(sce->val4) {
 					struct skill_unit_group *group = skill_id2group(sce->val4);
 					sce->val4 = 0;
-					if( group )
+					if( group ) /* might have been cleared before status ended, e.g. land protector */
 						skill_delunitgroup(group);
 				}
 			break;